cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [1/2] git commit: Explicitly check that startPage exists before attempting to launch
Date Tue, 27 May 2014 01:10:52 GMT
Repository: cordova-app-harness
Updated Branches:
  refs/heads/master de2743ec8 -> a8c23d632


Explicitly check that startPage exists before attempting to launch


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/10e6be0a
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/10e6be0a
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/10e6be0a

Branch: refs/heads/master
Commit: 10e6be0ad35bf5d37d4bc30a666076fec3009718
Parents: de2743e
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Mon May 26 21:10:08 2014 -0400
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Mon May 26 21:10:08 2014 -0400

----------------------------------------------------------------------
 www/cdvah/js/AppsService.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/10e6be0a/www/cdvah/js/AppsService.js
----------------------------------------------------------------------
diff --git a/www/cdvah/js/AppsService.js b/www/cdvah/js/AppsService.js
index 3063fc2..0d3f2e5 100644
--- a/www/cdvah/js/AppsService.js
+++ b/www/cdvah/js/AppsService.js
@@ -161,7 +161,13 @@
                     activeInstaller = installer;
                     return installer.launch();
                 }).then(function(launchUrl) {
-                    return AppHarnessUI.create(launchUrl);
+                    // Don't just use ResourcesLoader.doesFileExist because remaps might
make it exist.
+                    return ResourcesLoader.xhrGet(launchUrl)
+                    .then(function() {
+                        return AppHarnessUI.create(launchUrl);
+                    }, function() {
+                        throw new Error('Start file does not exist: ' + launchUrl.replace(/.*?\/www\//,
'www/'));
+                    });
                 });
             },
 


Mime
View raw message