You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by br...@apache.org on 2014/01/27 17:04:18 UTC
[3/6] git commit: Update AppHarness to modern MCA,
which expects to be loaded with file://
Update AppHarness to modern MCA, which expects to be loaded with file://
Also required fixing the remapped paths a bit. CRX apps are loading
correctly now.
Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/6f99f08d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/6f99f08d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/6f99f08d
Branch: refs/heads/master
Commit: 6f99f08d8a2f8fa3aa2067a68c35bdfb53410952
Parents: 1245da1
Author: Braden Shepherdson <br...@gmail.com>
Authored: Tue Jan 21 10:02:49 2014 -0500
Committer: Braden Shepherdson <br...@gmail.com>
Committed: Tue Jan 21 10:02:49 2014 -0500
----------------------------------------------------------------------
www/cdvah/crx_files/config.android.xml | 2 +-
www/cdvah/crx_files/config.ios.xml | 2 +-
www/cdvah/js/Installer.js | 12 +++++-------
3 files changed, 7 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/6f99f08d/www/cdvah/crx_files/config.android.xml
----------------------------------------------------------------------
diff --git a/www/cdvah/crx_files/config.android.xml b/www/cdvah/crx_files/config.android.xml
index 24126a4..27f4782 100644
--- a/www/cdvah/crx_files/config.android.xml
+++ b/www/cdvah/crx_files/config.android.xml
@@ -92,7 +92,7 @@
<param name="onload" value="true" />
</feature>
- <content src="chrome-extension://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/chromeapp.html" />
+ <content src="plugins/org.chromium.bootstrap/chromeapp.html" />
<access origin="*" />
<access origin="chrome-extension://*" />
<access origin="cdv-app-harness://*" />
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/6f99f08d/www/cdvah/crx_files/config.ios.xml
----------------------------------------------------------------------
diff --git a/www/cdvah/crx_files/config.ios.xml b/www/cdvah/crx_files/config.ios.xml
index c6d446b..422f393 100644
--- a/www/cdvah/crx_files/config.ios.xml
+++ b/www/cdvah/crx_files/config.ios.xml
@@ -78,7 +78,7 @@
<param name="ios-package" value="ChromeExtensionURLs" />
<param name="onload" value="true" />
</feature>
- <content src="chrome-extension://ohgfbmefaoadakchflddcopcmphnlcba/chromeapp.html" />
+ <content src="plugins/org.chromium.bootstrap/chromeapp.html" />
<feature name="ChromeSocket">
<param name="ios-package" value="ChromeSocket" />
</feature>
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/6f99f08d/www/cdvah/js/Installer.js
----------------------------------------------------------------------
diff --git a/www/cdvah/js/Installer.js b/www/cdvah/js/Installer.js
index 8a58d1c..79161fb 100644
--- a/www/cdvah/js/Installer.js
+++ b/www/cdvah/js/Installer.js
@@ -121,24 +121,22 @@
// Override cordova.js, cordova_plugins.js, and www/plugins to point at bundled plugins.
UrlRemap.aliasUri('/cordova\\.js.*', '.+', harnessDir + '/cordova.js', false /* redirect */);
UrlRemap.aliasUri('/cordova_plugins\\.js.*', '.+', harnessDir + '/cordova_plugins.js', false /* redirect */);
- if (startLocation.indexOf('chrome-extension://') === 0) {
+
+ // We want the /www/ for Cordova apps, and no /www/ for CRX apps.
+ var installSubdir = type == 'crx' ? '/' : '/www/';
+ if (startLocation.indexOf('chromeapp.html') >= 0) {
var pluginsUrl = 'chrome-extension://[^/]+/plugins/';
UrlRemap.aliasUri('^' + pluginsUrl, '^' + pluginsUrl, harnessDir + '/plugins/', false /* redirect */);
- var bootstrapUrl = 'chrome-extension://[^/]+/chrome(?:app\\.html|bgpage\\.html|appstyles\\.css)';
- UrlRemap.aliasUri('^' + bootstrapUrl, '^chrome-extension://[^/]+/', harnessDir + '/', false /* redirect */);
-
var chromeExtensionUrl = 'chrome-extension://[^\/]+/(?!!gap_exec)';
// Add the extra mapping for chrome-extension://aaaa... to point to the install location.
- // We want the /www/ for Cordova apps, and no /www/ for CRX apps.
- var installSubdir = type == 'crx' ? '/' : '/www/';
UrlRemap.aliasUri('^' + chromeExtensionUrl, '^' + chromeExtensionUrl, installUrl + installSubdir, false /* redirect */);
} else {
var pluginsUrl = startLocation.replace(/\/www\/.*/, '/www/plugins/');
UrlRemap.aliasUri('^' + pluginsUrl, '^' + pluginsUrl, harnessDir + '/plugins/', false /* redirect */);
}
// Make any references to www/ point to the app's install location.
- UrlRemap.aliasUri('^' + harnessDir, '^' + harnessDir, installUrl + '/www', false /* redirect */);
+ UrlRemap.aliasUri('^' + harnessDir, '^' + harnessDir, installUrl + installSubdir, false /* redirect */);
// Set-up app-harness: scheme to point at the harness.
UrlRemap.aliasUri('^app-harness:///cdvah/index.html', '^app-harness://', harnessDir, true);
return UrlRemap.aliasUri('^app-harness:', '^app-harness://', harnessDir, false)