Backed out changeset 6d2ffe8dc046 (bug 981249) for Linux ASAN test failure
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 26 Mar 2014 11:43:16 +0100
changeset 175501 ffaf9cf6616c571c2223c5d8a89a6fab8eaed8d6
parent 175500 c1f815536bdea65ded87af8788ca4976d3a2d8c8
child 175502 91a4c3026e8a8ec589ef2c3a62fcae6c53cecd39
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
bugs981249
milestone31.0a1
backs out6d2ffe8dc04699778a59491472d1532d59d5de9a
Backed out changeset 6d2ffe8dc046 (bug 981249) for Linux ASAN test failure
testing/profiles/webapps_mochitest.json
toolkit/webapps/tests/app.sjs
toolkit/webapps/tests/chrome.ini
toolkit/webapps/tests/data/app/index.html
toolkit/webapps/tests/data/app/manifest.webapp
toolkit/webapps/tests/head.js
toolkit/webapps/tests/test_hosted.xul
toolkit/webapps/tests/test_hosted_launch.xul
toolkit/webapps/tests/test_packaged.xul
toolkit/webapps/tests/test_packaged_launch.xul
webapprt/CommandLineHandler.js
webapprt/Startup.jsm
webapprt/WebappRT.jsm
--- a/testing/profiles/webapps_mochitest.json
+++ b/testing/profiles/webapps_mochitest.json
@@ -89,26 +89,10 @@
   },
   {
     "name": "https_a_domain_privileged",
     "csp": "",
     "origin": "https://aprivileged.com",
     "manifestURL": "https://aprivileged.com/manifest.webapp",
     "description": "https://aprivileged.com Privileged App ",
     "appStatus": 2
-  },
-  {
-    "name": "test_desktop_hosted_launch",
-    "csp": "",
-    "origin": "http://127.0.0.1:8888/",
-    "manifestURL": "http://127.0.0.1:8888/sample.manifest",
-    "description": "Hosted app",
-    "appStatus": 1
-  },
-  {
-    "name": "test_desktop_packaged_launch",
-    "csp": "",
-    "origin": "app://test_desktop_packaged_launch",
-    "manifestURL": "http://127.0.0.1:8888/sample.manifest",
-    "description": "Packaged App",
-    "appStatus": 2
   }
 ]
deleted file mode 100644
--- a/toolkit/webapps/tests/app.sjs
+++ /dev/null
@@ -1,33 +0,0 @@
-function getQuery(request) {
-  let query = {};
-
-  request.queryString.split('&').forEach(function(val) {
-    let [name, value] = val.split('=');
-    query[name] = unescape(value);
-  });
-
-  return query;
-}
-
-function handleRequest(request, response) {
-  response.setHeader("Cache-Control", "no-cache", false);
-
-  let query = getQuery(request);
-
-  if ("appreq" in query) {
-    response.setHeader("Content-Type", "text/plain", false);
-    response.write("Hello world!");
-
-    setState("appreq", "done");
-
-    return;
-  }
-
-  if ("testreq" in query) {
-    response.setHeader("Content-Type", "text/plain", false);
-
-    response.write(getState("appreq"));
-
-    return;
-  }
-}
--- a/toolkit/webapps/tests/chrome.ini
+++ b/toolkit/webapps/tests/chrome.ini
@@ -1,15 +1,8 @@
 [DEFAULT]
 support-files =
   head.js
-  app.sjs
-  data/app/index.html
-  data/app/manifest.webapp
 
 [test_hosted.xul]
 skip-if = os == "mac"
 [test_packaged.xul]
 skip-if = os == "mac"
-[test_hosted_launch.xul]
-skip-if = os == "mac"
-[test_packaged_launch.xul]
-skip-if = os == "mac"
deleted file mode 100644
--- a/toolkit/webapps/tests/data/app/index.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>Test app</title>
-</head>
-<body>
-Test app:
-<iframe src="http://127.0.0.1:8888/chrome/toolkit/webapps/tests/app.sjs?appreq"></iframe>
-</body>
-</html>
deleted file mode 100644
--- a/toolkit/webapps/tests/data/app/manifest.webapp
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-  "name": "Test app",
-  "description": "A test application",
-  "launch_path": "/index.html"
-}
--- a/toolkit/webapps/tests/head.js
+++ b/toolkit/webapps/tests/head.js
@@ -43,15 +43,8 @@ function wait(time) {
   let deferred = Promise.defer();
 
   setTimeout(function() {
     deferred.resolve();
   }, time);
 
   return deferred.promise;
 }
-
-// Helper to create a nsIFile from a set of path components
-function getFile() {
-  let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
-  file.initWithPath(OS.Path.join.apply(OS.Path, arguments));
-  return file;
-}
--- a/toolkit/webapps/tests/test_hosted.xul
+++ b/toolkit/webapps/tests/test_hosted.xul
@@ -244,17 +244,16 @@ Task.spawn(function() {
   // Install application
   info("Test installation");
   yield nativeApp.install(manifest);
   while (!WebappOSUtils.isLaunchable(app)) {
     yield wait(1000);
   }
   ok(true, "App launchable");
   ok((yield checkFiles(installedFiles)), "Files correctly written");
-  is(WebappOSUtils.getInstallPath(app), installPath, "getInstallPath == installPath");
 
   let stat = yield OS.File.stat(installPath);
   let installTime = stat.lastModificationDate;
 
   // Wait one second, otherwise the last modification date is the same.
   yield wait(1000);
 
   // Reinstall application
deleted file mode 100644
--- a/toolkit/webapps/tests/test_hosted_launch.xul
+++ /dev/null
@@ -1,226 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
-<?xml-stylesheet type="text/css" href="/tests/SimpleTest/test.css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=981249
--->
-<window title="Mozilla Bug 981249"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <script type="application/javascript"
-          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript" src="head.js"/>
-
-  <!-- test results are displayed in the html:body -->
-  <body xmlns="http://www.w3.org/1999/xhtml">
-  <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=981249"
-     target="_blank">Mozilla Bug 981249</a>
-  </body>
-
-<script type="application/javascript">
-<![CDATA[
-
-/** Test for Bug 981249 **/
-
-"use strict";
-
-SimpleTest.waitForExplicitFinish();
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/NativeApp.jsm");
-Cu.import("resource://gre/modules/WebappOSUtils.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
-
-let manifest = {
-  name: "test_desktop_hosted_launch",
-  launch_path: "/chrome/toolkit/webapps/tests/app.sjs?appreq",
-};
-
-let app = {
-  name: "test_desktop_hosted_launch",
-  manifestURL: "http://127.0.0.1:8888/sample.manifest",
-  manifest: manifest,
-  origin: "http://127.0.0.1:8888/",
-  categories: [],
-  installOrigin: "http://127.0.0.1:8888/",
-  receipts: [],
-  installTime: Date.now(),
-};
-
-let profileDir;
-let installPath;
-let exePath;
-let appProcess = Cc["@mozilla.org/process/util;1"].
-                 createInstance(Ci.nsIProcess);
-
-let cleanup;
-
-if (navigator.platform.startsWith("Linux")) {
-  installPath = OS.Path.join(OS.Constants.Path.homeDir, "." + WebappOSUtils.getUniqueName(app));
-  exePath = OS.Path.join(installPath, "webapprt-stub");
-
-  let xdg_data_home = Cc["@mozilla.org/process/environment;1"].
-                      getService(Ci.nsIEnvironment).
-                      get("XDG_DATA_HOME");
-  if (!xdg_data_home) {
-    xdg_data_home = OS.Path.join(OS.Constants.Path.homeDir, ".local", "share");
-  }
-
-  let desktopINI = OS.Path.join(xdg_data_home, "applications",
-                                "owa-" + WebappOSUtils.getUniqueName(app) + ".desktop");
-
-  cleanup = function() {
-    return Task.spawn(function*() {
-      if (appProcess.isRunning) {
-        appProcess.kill();
-      }
-
-      if (profileDir) {
-        yield OS.File.removeDir(profileDir.parent.path, { ignoreAbsent: true });
-      }
-
-      yield OS.File.removeDir(installPath, { ignoreAbsent: true });
-
-      yield OS.File.remove(desktopINI, { ignoreAbsent: true });
-    });
-  };
-} else if (navigator.platform.startsWith("Win")) {
-  installPath = OS.Path.join(OS.Constants.Path.winAppDataDir, WebappOSUtils.getUniqueName(app));
-  exePath = OS.Path.join(installPath, "test_desktop_hosted_launch.exe");
-
-  let desktopShortcut = OS.Path.join(OS.Constants.Path.desktopDir, "test_desktop_hosted_launch.lnk");
-  let startMenuShortcut = OS.Path.join(OS.Constants.Path.winStartMenuProgsDir, "test_desktop_hosted_launch.lnk");
-
-  cleanup = function() {
-    return Task.spawn(function*() {
-      if (appProcess.isRunning) {
-        appProcess.kill();
-      }
-
-      let uninstallKey;
-      try {
-        uninstallKey = Cc["@mozilla.org/windows-registry-key;1"].
-                       createInstance(Ci.nsIWindowsRegKey);
-        uninstallKey.open(uninstallKey.ROOT_KEY_CURRENT_USER,
-                          "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall",
-                          uninstallKey.ACCESS_WRITE);
-        if (uninstallKey.hasChild(WebappOSUtils.getUniqueName(app))) {
-          uninstallKey.removeChild(WebappOSUtils.getUniqueName(app));
-        }
-      } catch (e) {
-      } finally {
-        if (uninstallKey) {
-          uninstallKey.close();
-        }
-      }
-
-      if (profileDir) {
-        yield OS.File.removeDir(profileDir.parent.parent.path, { ignoreAbsent: true });
-      }
-
-      yield OS.File.removeDir(installPath, { ignoreAbsent: true });
-
-      yield OS.File.remove(desktopShortcut, { ignoreAbsent: true });
-      yield OS.File.remove(startMenuShortcut, { ignoreAbsent: true });
-    });
-  };
-} else if (navigator.platform.startsWith("Mac")) {
-  installPath = OS.Path.join(OS.Constants.Path.macLocalApplicationsDir, "test_desktop_hosted_launch.app");
-  exePath = OS.Path.join(installPath, "Contents", "MacOS", "webapprt");
-
-  let appProfileDir = OS.Path.join(OS.Constants.Path.macUserLibDir, "Application Support",
-                                   WebappOSUtils.getUniqueName(app));
-
-  cleanup = function() {
-    return Task.spawn(function*() {
-      if (appProcess.isRunning) {
-        appProcess.kill();
-      }
-
-      if (profileDir) {
-        yield OS.File.removeDir(profileDir.parent.path, { ignoreAbsent: true });
-      }
-
-      yield OS.File.removeDir(installPath, { ignoreAbsent: true });
-
-      yield OS.File.removeDir(appProfileDir, { ignoreAbsent: true });
-    });
-  };
-}
-
-let old_dry_run;
-try {
-  old_dry_run = Services.prefs.getBoolPref("browser.mozApps.installer.dry_run");
-} catch (ex) {}
-
-Services.prefs.setBoolPref("browser.mozApps.installer.dry_run", false);
-
-SimpleTest.registerCleanupFunction(function() {
-  if (old_dry_run === undefined) {
-    Services.prefs.clearUserPref("browser.mozApps.installer.dry_run");
-  } else {
-    Services.prefs.setBoolPref("browser.mozApps.installer.dry_run", old_dry_run);
-  }
-
-  cleanup();
-});
-
-function wasAppSJSAccessed() {
-  let deferred = Promise.defer();
-
-  var xhr = new XMLHttpRequest();
-
-  xhr.addEventListener("load", function() {
-    let ret = (xhr.responseText == "done") ? true : false;
-    deferred.resolve(ret);
-  });
-
-  xhr.addEventListener("error", aError => deferred.reject(aError));
-  xhr.addEventListener("abort", aError => deferred.reject(aError));
-
-  xhr.open('GET', 'http://test/chrome/toolkit/webapps/tests/app.sjs?testreq', true);
-  xhr.send();
-
-  return deferred.promise;
-}
-
-Task.spawn(function*() {
-  // Get to a clean state before the test
-  yield cleanup();
-
-  let nativeApp = new NativeApp(app, manifest, app.categories);
-  ok(nativeApp, "NativeApp object created");
-
-  profileDir = nativeApp.createProfile();
-  ok(profileDir && profileDir.exists(), "Profile directory created");
-
-  // Install application
-  info("Test installation");
-  yield nativeApp.install(manifest);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-
-  let exeFile = getFile(exePath);
-
-  ok(exeFile.isExecutable(), "webapprt executable is executable");
-
-  let appClosed = false;
-
-  appProcess.init(exeFile)
-  appProcess.runAsync([], 0, () => appClosed = true);
-
-  while (!(yield wasAppSJSAccessed()) && !appClosed) {
-    yield wait(1000);
-  }
-  ok(!appClosed, "App was launched and is still running");
-
-  SimpleTest.finish();
-}).then(null, function(e) {
-  ok(false, "Error during test: " + e);
-  SimpleTest.finish();
-});
-
-]]>
-</script>
-</window>
--- a/toolkit/webapps/tests/test_packaged.xul
+++ b/toolkit/webapps/tests/test_packaged.xul
@@ -262,17 +262,16 @@ Task.spawn(function() {
   // Install application
   info("Test installation");
   yield nativeApp.install(manifest, zipPath);
   while (!WebappOSUtils.isLaunchable(app)) {
     yield wait(1000);
   }
   ok(true, "App launchable");
   ok((yield checkFiles(installedFiles)), "Files correctly written");
-  is(WebappOSUtils.getInstallPath(app), installPath, "getInstallPath == installPath");
 
   let stat = yield OS.File.stat(installPath);
   let installTime = stat.lastModificationDate;
 
   // Wait one second, otherwise the last modification date is the same.
   yield wait(1000);
 
   // Reinstall application
deleted file mode 100644
--- a/toolkit/webapps/tests/test_packaged_launch.xul
+++ /dev/null
@@ -1,256 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
-<?xml-stylesheet type="text/css" href="/tests/SimpleTest/test.css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=981249
--->
-<window title="Mozilla Bug 981249"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <script type="application/javascript"
-          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript"
-          src="chrome://mochikit/content/chrome-harness.js"></script>
-  <script type="application/javascript" src="head.js"/>
-
-  <!-- test results are displayed in the html:body -->
-  <body xmlns="http://www.w3.org/1999/xhtml">
-  <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=981249"
-     target="_blank">Mozilla Bug 981249</a>
-  </body>
-
-<script type="application/javascript">
-<![CDATA[
-
-/** Test for Bug 981249 **/
-
-"use strict";
-
-SimpleTest.waitForExplicitFinish();
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/NativeApp.jsm");
-Cu.import("resource://gre/modules/WebappOSUtils.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
-
-const PR_RDWR        = 0x04;
-const PR_CREATE_FILE = 0x08;
-const PR_TRUNCATE    = 0x20;
-
-let manifest = {
-  name: "test_desktop_packaged_launch",
-  version: "0.1a",
-  size: 777,
-  package_path: "/data/app.zip",
-  launch_path: "/index.html",
-};
-
-let app = {
-  name: "test_desktop_packaged_launch",
-  manifestURL: "http://127.0.0.1:8888/sample.manifest",
-  manifest: manifest,
-  updateManifest: manifest,
-  origin: "app://test_desktop_packaged_launch/",
-  categories: [],
-  installOrigin: "http://127.0.0.1:8888/",
-  receipts: [],
-  installTime: Date.now(),
-};
-
-let profileDir;
-let installPath;
-let exePath;
-let appProcess = Cc["@mozilla.org/process/util;1"].
-                 createInstance(Ci.nsIProcess);
-
-let cleanup;
-
-if (navigator.platform.startsWith("Linux")) {
-  installPath = OS.Path.join(OS.Constants.Path.homeDir, "." + WebappOSUtils.getUniqueName(app));
-  exePath = OS.Path.join(installPath, "webapprt-stub");
-
-  let xdg_data_home = Cc["@mozilla.org/process/environment;1"].
-                      getService(Ci.nsIEnvironment).
-                      get("XDG_DATA_HOME");
-  if (!xdg_data_home) {
-    xdg_data_home = OS.Path.join(OS.Constants.Path.homeDir, ".local", "share");
-  }
-
-  let desktopINI = OS.Path.join(xdg_data_home, "applications",
-                                "owa-" + WebappOSUtils.getUniqueName(app) + ".desktop");
-
-  cleanup = function() {
-    return Task.spawn(function*() {
-      if (appProcess.isRunning) {
-        appProcess.kill();
-      }
-
-      if (profileDir) {
-        yield OS.File.removeDir(profileDir.parent.path, { ignoreAbsent: true });
-      }
-
-      yield OS.File.removeDir(installPath, { ignoreAbsent: true });
-
-      yield OS.File.remove(desktopINI, { ignoreAbsent: true });
-    });
-  };
-} else if (navigator.platform.startsWith("Win")) {
-  installPath = OS.Path.join(OS.Constants.Path.winAppDataDir, WebappOSUtils.getUniqueName(app));
-  exePath = OS.Path.join(installPath, "test_desktop_packaged_launch.exe");
-
-  let desktopShortcut = OS.Path.join(OS.Constants.Path.desktopDir, "test_desktop_packaged_launch.lnk");
-  let startMenuShortcut = OS.Path.join(OS.Constants.Path.winStartMenuProgsDir, "test_desktop_packaged_launch.lnk");
-
-  cleanup = function() {
-    return Task.spawn(function*() {
-      if (appProcess.isRunning) {
-        appProcess.kill();
-      }
-
-      let uninstallKey;
-      try {
-        uninstallKey = Cc["@mozilla.org/windows-registry-key;1"].
-                       createInstance(Ci.nsIWindowsRegKey);
-        uninstallKey.open(uninstallKey.ROOT_KEY_CURRENT_USER,
-                          "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall",
-                          uninstallKey.ACCESS_WRITE);
-        if (uninstallKey.hasChild(WebappOSUtils.getUniqueName(app))) {
-          uninstallKey.removeChild(WebappOSUtils.getUniqueName(app));
-        }
-      } catch (e) {
-      } finally {
-        if (uninstallKey) {
-          uninstallKey.close();
-        }
-      }
-
-      if (profileDir) {
-        yield OS.File.removeDir(profileDir.parent.parent.path, { ignoreAbsent: true });
-      }
-
-      yield OS.File.removeDir(installPath, { ignoreAbsent: true });
-
-      yield OS.File.remove(desktopShortcut, { ignoreAbsent: true });
-      yield OS.File.remove(startMenuShortcut, { ignoreAbsent: true });
-    });
-  };
-} else if (navigator.platform.startsWith("Mac")) {
-  installPath = OS.Path.join(OS.Constants.Path.macLocalApplicationsDir, "test_desktop_packaged_launch.app");
-  exePath = OS.Path.join(installPath, "Contents", "MacOS", "webapprt");
-
-  let appProfileDir = OS.Path.join(OS.Constants.Path.macUserLibDir, "Application Support",
-                                   WebappOSUtils.getUniqueName(app));
-
-  cleanup = function() {
-    return Task.spawn(function*() {
-      if (appProcess.isRunning) {
-        appProcess.kill();
-      }
-
-      if (profileDir) {
-        yield OS.File.removeDir(profileDir.parent.path, { ignoreAbsent: true });
-      }
-
-      yield OS.File.removeDir(installPath, { ignoreAbsent: true });
-
-      yield OS.File.removeDir(appProfileDir, { ignoreAbsent: true });
-    });
-  };
-}
-
-let old_dry_run;
-try {
-  old_dry_run = Services.prefs.getBoolPref("browser.mozApps.installer.dry_run");
-} catch (ex) {}
-
-Services.prefs.setBoolPref("browser.mozApps.installer.dry_run", false);
-
-SimpleTest.registerCleanupFunction(function() {
-  if (old_dry_run === undefined) {
-    Services.prefs.clearUserPref("browser.mozApps.installer.dry_run");
-  } else {
-    Services.prefs.setBoolPref("browser.mozApps.installer.dry_run", old_dry_run);
-  }
-
-  cleanup();
-});
-
-function buildAppPackage() {
-  let zipFile = getFile(OS.Constants.Path.profileDir, "sample.zip");
-
-  let zipWriter = Cc["@mozilla.org/zipwriter;1"].createInstance(Ci.nsIZipWriter);
-  zipWriter.open(zipFile, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE);
-  zipWriter.addEntryFile("index.html",
-                         Ci.nsIZipWriter.COMPRESSION_NONE,
-                         getFile(getTestFilePath("data/app/index.html")),
-                         false);
-  zipWriter.addEntryFile("manifest.webapp",
-                         Ci.nsIZipWriter.COMPRESSION_NONE,
-                         getFile(getTestFilePath("data/app/manifest.webapp")),
-                         false);
-  zipWriter.close();
-
-  return zipFile.path;
-}
-
-function wasAppSJSAccessed() {
-  let deferred = Promise.defer();
-
-  var xhr = new XMLHttpRequest();
-
-  xhr.addEventListener("load", function() {
-    let ret = (xhr.responseText == "done") ? true : false;
-    deferred.resolve(ret);
-  });
-
-  xhr.addEventListener("error", aError => deferred.reject(aError));
-  xhr.addEventListener("abort", aError => deferred.reject(aError));
-
-  xhr.open('GET', 'http://test/chrome/toolkit/webapps/tests/app.sjs?testreq', true);
-  xhr.send();
-
-  return deferred.promise;
-}
-
-Task.spawn(function() {
-  // Get to a clean state before the test
-  yield cleanup();
-
-  let zipPath = buildAppPackage();
-
-  let nativeApp = new NativeApp(app, manifest, app.categories);
-  ok(nativeApp, "NativeApp object created");
-
-  profileDir = nativeApp.createProfile();
-  ok(profileDir && profileDir.exists(), "Profile directory created");
-
-  // Install application
-  info("Test installation");
-  yield nativeApp.install(manifest, zipPath);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-
-  let exeFile = getFile(exePath);
-
-  ok(exeFile.isExecutable(), "webapprt executable is executable");
-
-  let appClosed = false;
-
-  appProcess.init(exeFile)
-  appProcess.runAsync([], 0, () => appClosed = true);
-
-  while (!(yield wasAppSJSAccessed()) && !appClosed) {
-    yield wait(1000);
-  }
-  ok(!appClosed, "App was launched and is still running");
-
-  SimpleTest.finish();
-}).then(null, function(e) {
-  ok(false, "Error during test: " + e);
-  SimpleTest.finish();
-});
-
-]]>
-</script>
-</window>
--- a/webapprt/CommandLineHandler.js
+++ b/webapprt/CommandLineHandler.js
@@ -38,20 +38,17 @@ CommandLineHandler.prototype = {
       // We're opening the window here in order to show it as soon as possible.
       let window = Services.ww.openWindow(null,
                                           "chrome://webapprt/content/webapp.xul",
                                           "_blank",
                                           "chrome,dialog=no,resizable,scrollbars,centerscreen",
                                           null);
       // Load the module to start up the app
       Cu.import("resource://webapprt/modules/Startup.jsm");
-      startup(window).then(null, function (aError) {
-        dump("Error: " + aError + "\n");
-        Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit);
-      });
+      startup(window);
     }
   },
 
   /**
    * Handle debug command line option.
    *
    * @param cmdLine A nsICommandLine object.
    *
--- a/webapprt/Startup.jsm
+++ b/webapprt/Startup.jsm
@@ -141,10 +141,10 @@ this.startup = function(window) {
       appBrowser.addEventListener("load", function onLoad() {
         appBrowser.removeEventListener("load", onLoad, true);
         appBrowser.contentDocument.
           documentElement.mozRequestFullScreen();
       }, true);
     }
 
     WebappRT.startUpdateService();
-  });
+  }).then(null, Cu.reportError.bind(Cu));
 }
--- a/webapprt/WebappRT.jsm
+++ b/webapprt/WebappRT.jsm
@@ -25,17 +25,18 @@ XPCOMUtils.defineLazyModuleGetter(this, 
   'resource://gre/modules/NativeApp.jsm');
 
 XPCOMUtils.defineLazyServiceGetter(this, "appsService",
                                   "@mozilla.org/AppsService;1",
                                   "nsIAppsService");
 
 this.WebappRT = {
   get launchURI() {
-    return this.localeManifest.fullLaunchPath();
+    let manifest = this.localeManifest;
+    return manifest.fullLaunchPath();
   },
 
   get localeManifest() {
     return new ManifestHelper(this.config.app.manifest,
                               this.config.app.origin);
   },
 
   get appID() {