Bug 1238079 - remove the desktop web runtime; r=fabrice,mossop,gps,jryans,jmaher,marco
authorMyk Melez <myk@mykzilla.org>
Mon, 07 Mar 2016 13:32:26 -0800
changeset 287146 b5621f52feab3069643eaa78499fbcdc8cafc468
parent 287145 31655275a522c6a2696141df8466e6ece384ea96
child 287147 52007f2cba341367f30533da5b0e1172cfa1daf8
push id30065
push userkwierso@gmail.com
push dateWed, 09 Mar 2016 00:01:05 +0000
treeherdermozilla-central@886b5480b578 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfabrice, mossop, gps, jryans, jmaher, marco
bugs1238079
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1238079 - remove the desktop web runtime; r=fabrice,mossop,gps,jryans,jmaher,marco
.eslintignore
b2g/dev/app.mozbuild
browser/app.mozbuild
browser/base/content/browser.xul
browser/base/content/popup-notifications.inc
browser/components/nsBrowserGlue.js
browser/confvars.sh
browser/installer/package-manifest.in
browser/locales/Makefile.in
browser/locales/en-US/chrome/browser/browser.dtd
browser/locales/en-US/chrome/browser/browser.properties
browser/locales/filter.py
browser/locales/l10n.ini
browser/modules/WebappManager.jsm
browser/modules/moz.build
browser/themes/shared/notification-icons.inc.css
build/docs/test_manifests.rst
build/gen_test_packages_manifest.py
config/rules.mk
devtools/shared/apps/tests/unit/head_apps.js
dom/apps/AppsUtils.jsm
dom/apps/Webapps.jsm
dom/apps/tests/test_bug_945152.html
dom/apps/tests/test_packaged_app_asmjs.html
old-configure.in
python/mozbuild/mozbuild/artifacts.py
python/mozbuild/mozbuild/frontend/context.py
python/mozbuild/mozbuild/testing.py
python/mozbuild/mozpack/files.py
python/mozbuild/mozpack/test/test_packager_formats.py
testing/mach_commands.py
testing/mochitest/browser-harness.xul
testing/mochitest/browser-test.js
testing/mochitest/mach_commands.py
testing/mochitest/mochitest_options.py
testing/mochitest/runtests.py
testing/mochitest/tests/SimpleTest/SimpleTest.js
testing/mochitest/tests/SimpleTest/setup.js
testing/mozharness/configs/unittests/linux_unittest.py
testing/mozharness/configs/unittests/mac_unittest.py
testing/mozharness/configs/unittests/win_unittest.py
testing/mozharness/mach_commands.py
testing/mozharness/mozharness/mozilla/testing/errors.py
testing/mozharness/mozharness/mozilla/testing/testbase.py
testing/mozharness/scripts/desktop_unittest.py
toolkit/moz.build
toolkit/mozapps/installer/windows/nsis/makensis.mk
toolkit/webapps/LinuxNativeApp.js
toolkit/webapps/MacNativeApp.js
toolkit/webapps/NativeApp.jsm
toolkit/webapps/WebappOSUtils.jsm
toolkit/webapps/WinNativeApp.js
toolkit/webapps/moz.build
toolkit/webapps/tests/.eslintrc
toolkit/webapps/tests/Makefile.in
toolkit/webapps/tests/TestWebappRT.cpp
toolkit/webapps/tests/app.sjs
toolkit/webapps/tests/chrome.ini
toolkit/webapps/tests/data/512.png
toolkit/webapps/tests/data/app/hosted_manifest.webapp
toolkit/webapps/tests/data/app/index.html
toolkit/webapps/tests/data/app/manifest.webapp
toolkit/webapps/tests/data/appcached_app/index.html
toolkit/webapps/tests/data/appcached_app/manifest.appcache
toolkit/webapps/tests/data/appcached_app/manifest.appcache^headers^
toolkit/webapps/tests/data/appcached_app/manifest.webapp
toolkit/webapps/tests/data/appcached_app/manifest.webapp^headers^
toolkit/webapps/tests/data/custom_origin.webapp
toolkit/webapps/tests/data/custom_origin.webapp^headers^
toolkit/webapps/tests/data/custom_origin.zip
toolkit/webapps/tests/data/icon.png
toolkit/webapps/tests/head.js
toolkit/webapps/tests/moz.build
toolkit/webapps/tests/test_custom_origin.xul
toolkit/webapps/tests/test_custom_origin_uninstall_install.xul
toolkit/webapps/tests/test_hosted.xul
toolkit/webapps/tests/test_hosted_checkforupdates_from_webapp_runtime.xul
toolkit/webapps/tests/test_hosted_icons.xul
toolkit/webapps/tests/test_hosted_launch.xul
toolkit/webapps/tests/test_hosted_launch_no_registry.xul
toolkit/webapps/tests/test_hosted_uninstall.xul
toolkit/webapps/tests/test_hosted_update_from_webapp_runtime.xul
toolkit/webapps/tests/test_install_appcache.xul
toolkit/webapps/tests/test_non_ascii_app_name.xul
toolkit/webapps/tests/test_packaged.xul
toolkit/webapps/tests/test_packaged_checkforupdates_from_webapp_runtime.xul
toolkit/webapps/tests/test_packaged_icons.xul
toolkit/webapps/tests/test_packaged_launch.xul
toolkit/webapps/tests/test_packaged_launch_no_registry.xul
toolkit/webapps/tests/test_packaged_uninstall.xul
toolkit/webapps/tests/test_packaged_update_from_webapp_runtime.xul
toolkit/webapps/tests/test_webapp_runtime_executable_update.xul
webapprt/CommandLineHandler.js
webapprt/ContentPermission.js
webapprt/DirectoryProvider.js
webapprt/DownloadView.jsm
webapprt/PaymentUIGlue.js
webapprt/Startup.jsm
webapprt/WebRTCHandler.jsm
webapprt/WebappManager.jsm
webapprt/WebappRT.jsm
webapprt/components.manifest
webapprt/content/downloads/download.xml
webapprt/content/downloads/downloads.css
webapprt/content/downloads/downloads.js
webapprt/content/downloads/downloads.xul
webapprt/content/getUserMediaDialog.js
webapprt/content/getUserMediaDialog.xul
webapprt/content/mochitest-shared.js
webapprt/content/mochitest.js
webapprt/content/mochitest.xul
webapprt/content/webapp.js
webapprt/content/webapp.xul
webapprt/defs.mk
webapprt/gtk/Makefile.in
webapprt/gtk/moz.build
webapprt/gtk/webapprt.cpp
webapprt/jar.mn
webapprt/locales/en-US/webapp-uninstaller/webapp-uninstaller.properties
webapprt/locales/en-US/webapprt/downloads/downloads.dtd
webapprt/locales/en-US/webapprt/getUserMediaDialog.dtd
webapprt/locales/en-US/webapprt/overrides/appstrings.properties
webapprt/locales/en-US/webapprt/overrides/dom.properties
webapprt/locales/en-US/webapprt/webapp.dtd
webapprt/locales/en-US/webapprt/webapp.properties
webapprt/locales/jar.mn
webapprt/locales/l10n.ini
webapprt/locales/moz.build
webapprt/mac/Makefile.in
webapprt/mac/moz.build
webapprt/mac/webapprt.mm
webapprt/moz.build
webapprt/prefs.js
webapprt/test/chrome/TestApp.app/Contents/Info.plist
webapprt/test/chrome/TestApp.app/Contents/MacOS/webapp.ini
webapprt/test/chrome/alarm.html
webapprt/test/chrome/alarm.webapp
webapprt/test/chrome/alarm.webapp^headers^
webapprt/test/chrome/browser_alarm.js
webapprt/test/chrome/browser_download.js
webapprt/test/chrome/browser_geolocation-prompt-noperm.js
webapprt/test/chrome/browser_geolocation-prompt-perm.js
webapprt/test/chrome/browser_getUserMedia.js
webapprt/test/chrome/browser_install-app.js
webapprt/test/chrome/browser_mozpay.js
webapprt/test/chrome/browser_noperm.js
webapprt/test/chrome/browser_sample.js
webapprt/test/chrome/browser_webperm.js
webapprt/test/chrome/browser_window-open-blank.js
webapprt/test/chrome/browser_window-open-self.js
webapprt/test/chrome/browser_window-open.js
webapprt/test/chrome/browser_window-title.js
webapprt/test/chrome/debugger.html
webapprt/test/chrome/debugger.webapp
webapprt/test/chrome/debugger.webapp^headers^
webapprt/test/chrome/download.html
webapprt/test/chrome/download.test
webapprt/test/chrome/download.webapp
webapprt/test/chrome/download.webapp^headers^
webapprt/test/chrome/downloads/browser_add_download.js
webapprt/test/chrome/downloads/browser_remove_download.js
webapprt/test/chrome/downloads/webapprt.ini
webapprt/test/chrome/geolocation-prompt-noperm.html
webapprt/test/chrome/geolocation-prompt-noperm.webapp
webapprt/test/chrome/geolocation-prompt-noperm.webapp^headers^
webapprt/test/chrome/geolocation-prompt-perm.html
webapprt/test/chrome/geolocation-prompt-perm.webapp
webapprt/test/chrome/geolocation-prompt-perm.webapp^headers^
webapprt/test/chrome/getUserMedia.html
webapprt/test/chrome/getUserMedia.webapp
webapprt/test/chrome/getUserMedia.webapp^headers^
webapprt/test/chrome/head.js
webapprt/test/chrome/install-app.html
webapprt/test/chrome/install-app.webapp
webapprt/test/chrome/install-app.webapp^headers^
webapprt/test/chrome/mozpay-failure.html
webapprt/test/chrome/mozpay-success.html
webapprt/test/chrome/mozpay.html
webapprt/test/chrome/mozpay.webapp
webapprt/test/chrome/mozpay.webapp^headers^
webapprt/test/chrome/noperm.html
webapprt/test/chrome/noperm.webapp
webapprt/test/chrome/noperm.webapp^headers^
webapprt/test/chrome/sample.html
webapprt/test/chrome/sample.webapp
webapprt/test/chrome/sample.webapp^headers^
webapprt/test/chrome/webapprt.ini
webapprt/test/chrome/webperm.html
webapprt/test/chrome/webperm.webapp
webapprt/test/chrome/webperm.webapp^headers^
webapprt/test/chrome/window-open-blank.html
webapprt/test/chrome/window-open-blank.webapp
webapprt/test/chrome/window-open-blank.webapp^headers^
webapprt/test/chrome/window-open-self.html
webapprt/test/chrome/window-open-self.webapp
webapprt/test/chrome/window-open-self.webapp^headers^
webapprt/test/chrome/window-open.html
webapprt/test/chrome/window-open.webapp
webapprt/test/chrome/window-open.webapp^headers^
webapprt/test/chrome/window-title.html
webapprt/test/chrome/window-title.webapp
webapprt/test/chrome/window-title.webapp^headers^
webapprt/test/content/test.webapp
webapprt/test/content/test.webapp^headers^
webapprt/test/content/webapprt.ini
webapprt/test/content/webapprt_indexeddb.html
webapprt/test/content/webapprt_sample.html
webapprt/themes/LICENSE
webapprt/themes/linux/downloads/downloadIcon.png
webapprt/themes/linux/downloads/downloads.css
webapprt/themes/linux/jar.mn
webapprt/themes/linux/moz.build
webapprt/themes/moz.build
webapprt/themes/osx/downloads/buttons.png
webapprt/themes/osx/downloads/downloadIcon.png
webapprt/themes/osx/downloads/downloads.css
webapprt/themes/osx/jar.mn
webapprt/themes/osx/moz.build
webapprt/themes/windows/downloads/downloadButtons-XP.png
webapprt/themes/windows/downloads/downloadButtons.png
webapprt/themes/windows/downloads/downloadIcon-XP.png
webapprt/themes/windows/downloads/downloadIcon.png
webapprt/themes/windows/downloads/downloads.css
webapprt/themes/windows/jar.mn
webapprt/themes/windows/moz.build
webapprt/webapprt.ini
webapprt/win/Makefile.in
webapprt/win/moz.build
webapprt/win/webapp-uninstaller.nsi.in
webapprt/win/webapprt.cpp
webapprt/win/webapprt.exe.manifest
webapprt/win/webapprt.rc
--- a/.eslintignore
+++ b/.eslintignore
@@ -39,17 +39,16 @@ parser/**
 probes/**
 python/**
 rdf/**
 startupcache/**
 testing/**
 tools/**
 uriloader/**
 view/**
-webapprt/**
 widget/**
 xpcom/**
 xpfe/**
 xulrunner/**
 
 # b2g exclusions (pref files).
 b2g/app/b2g.js
 b2g/graphene/graphene.js
--- a/b2g/dev/app.mozbuild
+++ b/b2g/dev/app.mozbuild
@@ -5,19 +5,16 @@
 
 include('/toolkit/toolkit.mozbuild')
 
 if CONFIG['MOZ_EXTENSIONS']:
     DIRS += ['/extensions']
 
 DIRS += ['/%s' % CONFIG['MOZ_BRANDING_DIRECTORY']]
 
-if CONFIG['MOZ_WEBAPP_RUNTIME']:
-    DIRS += ['/webapprt']
-
 DIRS += [
     '/b2g/chrome',
     '/b2g/components',
     '/b2g/dev/app',
 
     # Never add dirs after browser because they apparently won't get
     # packaged properly on Mac.
     '/browser',
--- a/browser/app.mozbuild
+++ b/browser/app.mozbuild
@@ -5,14 +5,11 @@
 
 include('/toolkit/toolkit.mozbuild')
 
 if CONFIG['MOZ_EXTENSIONS']:
     DIRS += ['/extensions']
 
 DIRS += ['/%s' % CONFIG['MOZ_BRANDING_DIRECTORY']]
 
-if CONFIG['MOZ_WEBAPP_RUNTIME']:
-    DIRS += ['/webapprt']
-
 # Never add dirs after browser because they apparently won't get
 # packaged properly on Mac.
 DIRS += ['/browser']
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -673,18 +673,16 @@
                 <image id="addons-notification-icon" class="notification-anchor-icon" role="button"
                        aria-label="&urlbar.addonsNotificationAnchor.label;"/>
                 <image id="indexedDB-notification-icon" class="notification-anchor-icon" role="button"
                        aria-label="&urlbar.indexedDBNotificationAnchor.label;"/>
                 <image id="login-fill-notification-icon" class="notification-anchor-icon" role="button"
                        aria-label="&urlbar.loginFillNotificationAnchor.label;"/>
                 <image id="password-notification-icon" class="notification-anchor-icon" role="button"
                        aria-label="&urlbar.passwordNotificationAnchor.label;"/>
-                <image id="webapps-notification-icon" class="notification-anchor-icon" role="button"
-                       aria-label="&urlbar.webappsNotificationAnchor.label;"/>
                 <image id="plugins-notification-icon" class="notification-anchor-icon" role="button"
                        aria-label="&urlbar.pluginsNotificationAnchor.label;"/>
                 <image id="web-notifications-notification-icon" class="notification-anchor-icon" role="button"
                        aria-label="&urlbar.webNotsNotificationAnchor3.label;"/>
                 <image id="webRTC-shareDevices-notification-icon" class="notification-anchor-icon" role="button"
                        aria-label="&urlbar.webRTCShareDevicesNotificationAnchor.label;"/>
                 <image id="webRTC-sharingDevices-notification-icon" class="notification-anchor-icon" role="button"
                        aria-label="&urlbar.webRTCSharingDevicesNotificationAnchor.label;"/>
--- a/browser/base/content/popup-notifications.inc
+++ b/browser/base/content/popup-notifications.inc
@@ -34,20 +34,16 @@
                accesskey="&getUserMedia.selectMicrophone.accesskey;"
                control="webRTC-selectMicrophone-menulist"/>
         <menulist id="webRTC-selectMicrophone-menulist">
           <menupopup id="webRTC-selectMicrophone-menupopup"/>
         </menulist>
       </popupnotificationcontent>
     </popupnotification>
 
-    <popupnotification id="webapps-install-progress-notification" hidden="true">
-      <popupnotificationcontent id="webapps-install-progress-content" orient="vertical" align="start"/>
-    </popupnotification>
-
     <popupnotification id="servicesInstall-notification" hidden="true">
       <popupnotificationcontent orient="vertical" align="start">
         <!-- XXX bug 974146, tests are looking for this, can't remove yet. -->
       </popupnotificationcontent>
     </popupnotification>
 
     <popupnotification id="pointerLock-notification" hidden="true">
       <popupnotificationcontent orient="vertical" align="start">
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -47,19 +47,16 @@ XPCOMUtils.defineLazyModuleGetter(this, 
                                   "resource://gre/modules/PlacesUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "BookmarkHTMLUtils",
                                   "resource://gre/modules/BookmarkHTMLUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "BookmarkJSONUtils",
                                   "resource://gre/modules/BookmarkJSONUtils.jsm");
 
-XPCOMUtils.defineLazyModuleGetter(this, "WebappManager",
-                                  "resource:///modules/WebappManager.jsm");
-
 XPCOMUtils.defineLazyModuleGetter(this, "PageThumbs",
                                   "resource://gre/modules/PageThumbs.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "PdfJs",
                                   "resource://pdf.js/PdfJs.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "ProcessHangMonitor",
                                   "resource:///modules/ProcessHangMonitor.jsm");
@@ -737,17 +734,16 @@ BrowserGlue.prototype = {
 
     // apply distribution customizations
     // prefs are applied in _onAppDefaults()
     this._distributionCustomizer.applyCustomizations();
 
     // handle any UI migration
     this._migrateUI();
 
-    WebappManager.init();
     PageThumbs.init();
     webrtcUI.init();
     AboutHome.init();
 
     DirectoryLinksProvider.init();
     NewTabUtils.init();
     NewTabUtils.links.addProvider(DirectoryLinksProvider);
     AboutNewTab.init();
@@ -1052,19 +1048,16 @@ BrowserGlue.prototype = {
       let appStartup = Cc["@mozilla.org/toolkit/app-startup;1"]
                          .getService(Ci.nsIAppStartup);
       appStartup.trackStartupCrashEnd();
     } catch (e) {
       Cu.reportError("Could not end startup crash tracking in quit-application-granted: " + e);
     }
 
     SelfSupportBackend.uninit();
-
-    WebappManager.uninit();
-
     NewTabPrefsProvider.prefs.uninit();
     AboutNewTab.uninit();
     webrtcUI.uninit();
     FormValidationHandler.uninit();
     if (AppConstants.NIGHTLY_BUILD) {
       AddonWatcher.uninit();
     }
   },
--- a/browser/confvars.sh
+++ b/browser/confvars.sh
@@ -48,17 +48,16 @@ MOZ_APP_ID={ec8030f7-c20a-464f-9b0e-13a3
 # This should usually be the same as the value MAR_CHANNEL_ID.
 # If more than one ID is needed, then you should use a comma separated list
 # of values.
 ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-central
 # The MAR_CHANNEL_ID must not contain the following 3 characters: ",\t "
 MAR_CHANNEL_ID=firefox-mozilla-central
 MOZ_PROFILE_MIGRATOR=1
 MOZ_APP_STATIC_INI=1
-MOZ_WEBAPP_RUNTIME=1
 MOZ_MEDIA_NAVIGATOR=1
 MOZ_WEBGL_CONFORMANT=1
 # Enable navigator.mozPay
 MOZ_PAY=1
 # Enable activities. These are used for FxOS developers currently.
 MOZ_ACTIVITIES=1
 MOZ_JSDOWNLOADS=1
 MOZ_WEBM_ENCODER=1
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -831,41 +831,16 @@ bin/libfreebl_32int64_3.so
 #endif
 #endif
 @RESPATH@/browser/crashreporter-override.ini
 #ifdef MOZ_CRASHREPORTER_INJECTOR
 @BINPATH@/breakpadinjector.dll
 #endif
 #endif
 
-#ifdef MOZ_WEBAPP_RUNTIME
-[WebappRuntime]
-#ifdef XP_WIN
-@BINPATH@/webapp-uninstaller@BIN_SUFFIX@
-#endif
-@RESPATH@/webapprt-stub@BIN_SUFFIX@
-@RESPATH@/webapprt/webapprt.ini
-@RESPATH@/webapprt/chrome.manifest
-@RESPATH@/webapprt/chrome/webapprt@JAREXT@
-@RESPATH@/webapprt/chrome/webapprt.manifest
-@RESPATH@/webapprt/chrome/@AB_CD@@JAREXT@
-@RESPATH@/webapprt/chrome/@AB_CD@.manifest
-@RESPATH@/webapprt/components/CommandLineHandler.js
-@RESPATH@/webapprt/components/ContentPermission.js
-@RESPATH@/webapprt/components/DirectoryProvider.js
-@RESPATH@/webapprt/components/PaymentUIGlue.js
-@RESPATH@/webapprt/components/components.manifest
-@RESPATH@/webapprt/defaults/preferences/prefs.js
-@RESPATH@/webapprt/modules/DownloadView.jsm
-@RESPATH@/webapprt/modules/Startup.jsm
-@RESPATH@/webapprt/modules/WebappRT.jsm
-@RESPATH@/webapprt/modules/WebappManager.jsm
-@RESPATH@/webapprt/modules/WebRTCHandler.jsm
-#endif
-
 @RESPATH@/components/DataStore.manifest
 @RESPATH@/components/DataStoreImpl.js
 @RESPATH@/components/dom_datastore.xpt
 
 @RESPATH@/components/dom_audiochannel.xpt
 
 ; Shutdown Terminator
 @RESPATH@/components/nsTerminatorTelemetry.js
--- a/browser/locales/Makefile.in
+++ b/browser/locales/Makefile.in
@@ -95,19 +95,16 @@ searchplugins:: $(list-txt)
 	$(NSINSTALL) -D $@
 
 DEFINES += -DBOOKMARKS_INCLUDE_DIR=$(dir $(call MERGE_FILE,profile/bookmarks.inc))
 
 libs-%:
 	$(NSINSTALL) -D $(DIST)/install
 	@$(MAKE) -C ../../toolkit/locales libs-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
 	@$(MAKE) -C ../../services/sync/locales AB_CD=$* XPI_NAME=locale-$*
-ifdef MOZ_WEBAPP_RUNTIME
-	@$(MAKE) -C ../../webapprt/locales AB_CD=$* XPI_NAME=locale-$*
-endif
 	@$(MAKE) -C ../../extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$*
 	@$(MAKE) -C ../extensions/pocket/locales AB_CD=$* XPI_NAME=locale-$*
 	@$(MAKE) -C ../extensions/loop/chrome/locale AB_CD=$* XPI_NAME=locale-$*
 	@$(MAKE) -C ../../intl/locales AB_CD=$* XPI_NAME=locale-$*
 	@$(MAKE) -C ../../devtools/client/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
 	@$(MAKE) -B searchplugins AB_CD=$* XPI_NAME=locale-$*
 	@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=$(PREF_DIR)
 	@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$*
@@ -133,24 +130,21 @@ repackage-zip-%: repackage-win32-install
 else
 repackage-win32-installer-%: ;
 endif
 
 
 clobber-zip:
 	$(RM) $(STAGEDIST)/chrome/$(AB_CD).jar \
 	  $(STAGEDIST)/chrome/$(AB_CD).manifest \
-	  $(STAGEDIST)/webapprt/chrome/$(AB_CD).jar \
-	  $(STAGEDIST)/webapprt/chrome/$(AB_CD).manifest \
 	  $(STAGEDIST)/$(PREF_DIR)/firefox-l10n.js
 	$(RM) -rf  $(STAGEDIST)/dictionaries \
 	  $(STAGEDIST)/hyphenation \
 	  $(STAGEDIST)/defaults/profile \
-	  $(STAGEDIST)/chrome/$(AB_CD) \
-	  $(STAGEDIST)/webapprt/chrome/$(AB_CD)
+	  $(STAGEDIST)/chrome/$(AB_CD)
 
 
 langpack: langpack-$(AB_CD)
 
 # This is a generic target that will make a langpack, repack ZIP (+tarball)
 # builds, and repack an installer if applicable. It is called from the
 # tinderbox scripts. Alter it with caution.
 
--- a/browser/locales/en-US/chrome/browser/browser.dtd
+++ b/browser/locales/en-US/chrome/browser/browser.dtd
@@ -192,17 +192,16 @@ These should match what Safari and other
      used to provide accessible labels to users of assistive technology like screenreaders.
      It is not possible to see them visually in the UI. -->
 <!ENTITY urlbar.defaultNotificationAnchor.label         "View a notification">
 <!ENTITY urlbar.geolocationNotificationAnchor.label     "View the location request">
 <!ENTITY urlbar.addonsNotificationAnchor.label          "View the add-on install message">
 <!ENTITY urlbar.indexedDBNotificationAnchor.label       "View the app-offline storage message">
 <!ENTITY urlbar.loginFillNotificationAnchor.label       "Manage your login information">
 <!ENTITY urlbar.passwordNotificationAnchor.label        "Check if you want to save your password">
-<!ENTITY urlbar.webappsNotificationAnchor.label         "View the app install message">
 <!ENTITY urlbar.pluginsNotificationAnchor.label         "Manage plugin usage on this page">
 <!ENTITY urlbar.webNotsNotificationAnchor3.label        "Change whether you can receive notifications from the site">
 
 <!ENTITY urlbar.webRTCShareDevicesNotificationAnchor.label      "Manage sharing your camera and/or microphone with the site">
 <!ENTITY urlbar.webRTCSharingDevicesNotificationAnchor.label    "You are sharing your camera and/or microphone with the site">
 <!ENTITY urlbar.webRTCShareMicrophoneNotificationAnchor.label   "Manage sharing your microphone with the site">
 <!ENTITY urlbar.webRTCSharingMicrophoneNotificationAnchor.label "You are sharing your microphone with the site">
 <!ENTITY urlbar.webRTCShareScreenNotificationAnchor.label       "Manage sharing your windows or screen with the site">
--- a/browser/locales/en-US/chrome/browser/browser.properties
+++ b/browser/locales/en-US/chrome/browser/browser.properties
@@ -468,30 +468,16 @@ dataReportingNotification.button.accessK
 processHang.label = A web page is slowing down your browser. What would you like to do?
 processHang.button_stop.label = Stop It
 processHang.button_stop.accessKey = S
 processHang.button_wait.label = Wait
 processHang.button_wait.accessKey = W
 processHang.button_debug.label = Debug Script
 processHang.button_debug.accessKey = D
 
-# Webapps notification popup
-webapps.install = Install
-webapps.install.accesskey = I
-#LOCALIZATION NOTE (webapps.requestInstall2) %S is the web app name
-webapps.requestInstall2 = Do you want to install “%S” from this site?
-webapps.install.success = Application Installed
-webapps.install.inprogress = Installation in progress
-webapps.uninstall = Uninstall
-webapps.uninstall.accesskey = U
-webapps.doNotUninstall = Don't Uninstall
-webapps.doNotUninstall.accesskey = D
-#LOCALIZATION NOTE (webapps.requestUninstall) %1$S is the web app name
-webapps.requestUninstall = Do you want to uninstall “%1$S”?
-
 # LOCALIZATION NOTE (fullscreenButton.tooltip): %S is the keyboard shortcut for full screen
 fullscreenButton.tooltip=Display the window in full screen (%S)
 
 service.toolbarbutton.label=Services
 service.toolbarbutton.tooltiptext=Services
 
 # LOCALIZATION NOTE (social.install.description): %1$S is the hostname of the social provider, %2$S is brandShortName (e.g. Firefox)
 service.install.description=Would you like to enable services from %1$S to display in your %2$S toolbar and sidebar?
--- a/browser/locales/filter.py
+++ b/browser/locales/filter.py
@@ -2,17 +2,17 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 def test(mod, path, entity = None):
   import re
   # ignore anything but Firefox
   if mod not in ("netwerk", "dom", "toolkit", "security/manager",
                  "devtools/client", "devtools/shared",
-                 "browser", "webapprt",
+                 "browser",
                  "extensions/reporter", "extensions/spellcheck",
                  "other-licenses/branding/firefox",
                  "browser/branding/official",
                  "services/sync",
                  "browser/extensions/pocket"):
     return "ignore"
   if mod not in ("browser", "extensions/spellcheck"):
     # we only have exceptions for browser and extensions/spellcheck
--- a/browser/locales/l10n.ini
+++ b/browser/locales/l10n.ini
@@ -14,12 +14,11 @@ dirs = browser
      devtools/client
      browser/extensions/pocket
 
 [includes]
 # non-central apps might want to use %(topsrcdir)s here, or other vars
 # RFE: that needs to be supported by compare-locales, too, though
 toolkit = toolkit/locales/l10n.ini
 services_sync = services/sync/locales/l10n.ini
-webapprt = webapprt/locales/l10n.ini
 
 [extras]
 dirs = extensions/spellcheck
deleted file mode 100644
--- a/browser/modules/WebappManager.jsm
+++ /dev/null
@@ -1,335 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-this.EXPORTED_SYMBOLS = ["WebappManager"];
-
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cu = Components.utils;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Webapps.jsm");
-Cu.import("resource://gre/modules/AppsUtils.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "NativeApp",
-  "resource://gre/modules/NativeApp.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "WebappOSUtils",
-  "resource://gre/modules/WebappOSUtils.jsm");
-
-XPCOMUtils.defineLazyServiceGetter(this, "cpmm",
-                                   "@mozilla.org/childprocessmessagemanager;1",
-                                   "nsIMessageSender");
-
-this.WebappManager = {
-  // List of promises for in-progress installations
-  installations: {},
-
-  init: function() {
-    Services.obs.addObserver(this, "webapps-ask-install", false);
-    Services.obs.addObserver(this, "webapps-ask-uninstall", false);
-    Services.obs.addObserver(this, "webapps-launch", false);
-    Services.obs.addObserver(this, "webapps-uninstall", false);
-    cpmm.sendAsyncMessage("Webapps:RegisterForMessages",
-                          { messages: ["Webapps:Install:Return:OK",
-                                       "Webapps:Install:Return:KO",
-                                       "Webapps:UpdateState"]});
-    cpmm.addMessageListener("Webapps:Install:Return:OK", this);
-    cpmm.addMessageListener("Webapps:Install:Return:KO", this);
-    cpmm.addMessageListener("Webapps:UpdateState", this);
-  },
-
-  uninit: function() {
-    Services.obs.removeObserver(this, "webapps-ask-install");
-    Services.obs.removeObserver(this, "webapps-ask-uninstall");
-    Services.obs.removeObserver(this, "webapps-launch");
-    Services.obs.removeObserver(this, "webapps-uninstall");
-    cpmm.sendAsyncMessage("Webapps:UnregisterForMessages",
-                          ["Webapps:Install:Return:OK",
-                           "Webapps:Install:Return:KO",
-                           "Webapps:UpdateState"]);
-    cpmm.removeMessageListener("Webapps:Install:Return:OK", this);
-    cpmm.removeMessageListener("Webapps:Install:Return:KO", this);
-    cpmm.removeMessageListener("Webapps:UpdateState", this);
-  },
-
-  receiveMessage: function(aMessage) {
-    let data = aMessage.data;
-
-    let manifestURL = data.manifestURL ||
-                      (data.app && data.app.manifestURL) ||
-                      data.manifest;
-
-    if (!this.installations[manifestURL]) {
-      return;
-    }
-
-    if (aMessage.name == "Webapps:UpdateState") {
-      if (data.error) {
-        this.installations[manifestURL].reject(data.error);
-      } else if (data.app.installState == "installed") {
-        this.installations[manifestURL].resolve();
-      }
-    } else if (aMessage.name == "Webapps:Install:Return:OK" &&
-               !data.isPackage) {
-      let manifest = new ManifestHelper(data.app.manifest,
-                                        data.app.origin,
-                                        data.app.manifestURL);
-      if (!manifest.appcache_path) {
-        this.installations[manifestURL].resolve();
-      }
-    } else if (aMessage.name == "Webapps:Install:Return:KO") {
-      this.installations[manifestURL].reject(data.error);
-    }
-  },
-
-  observe: function(aSubject, aTopic, aData) {
-    let data = JSON.parse(aData);
-    data.mm = aSubject;
-
-    let browser;
-    switch(aTopic) {
-      case "webapps-ask-install":
-        browser = this._getBrowserForId(data.topId);
-        if (browser) {
-          this.doInstall(data, browser);
-        }
-        break;
-      case "webapps-ask-uninstall":
-        browser = this._getBrowserForId(data.topId);
-        if (browser) {
-          this.doUninstall(data, browser);
-        }
-        break;
-      case "webapps-launch":
-        WebappOSUtils.launch(data);
-        break;
-      case "webapps-uninstall":
-        WebappOSUtils.uninstall(data);
-        break;
-    }
-  },
-
-  _getBrowserForId: function(aId) {
-    let windows = Services.wm.getEnumerator("navigator:browser");
-    while (windows.hasMoreElements()) {
-      let window = windows.getNext();
-      let tabbrowser = window.gBrowser;
-      let foundBrowser = tabbrowser.getBrowserForOuterWindowID(aId);
-      if (foundBrowser) {
-        return foundBrowser;
-      }
-    }
-    let foundWindow = Services.wm.getOuterWindowWithId(aId);
-    if (foundWindow) {
-      return foundWindow.QueryInterface(Ci.nsIInterfaceRequestor)
-                        .getInterface(Ci.nsIWebNavigation)
-                        .QueryInterface(Ci.nsIDocShell)
-                        .chromeEventHandler;
-    }
-    return null;
-  },
-
-  doInstall: function(aData, aBrowser) {
-    let chromeDoc = aBrowser.ownerDocument;
-    let chromeWin = chromeDoc.defaultView;
-    let popupProgressContent =
-      chromeDoc.getElementById("webapps-install-progress-content");
-
-    let bundle = chromeWin.gNavigatorBundle;
-
-    let jsonManifest = aData.isPackage ? aData.app.updateManifest : aData.app.manifest;
-
-    let notification;
-
-    let mainAction = {
-      label: bundle.getString("webapps.install"),
-      accessKey: bundle.getString("webapps.install.accesskey"),
-      callback: () => {
-        notification.remove();
-
-        notification = chromeWin.PopupNotifications.
-                        show(aBrowser,
-                             "webapps-install-progress",
-                             bundle.getString("webapps.install.inprogress"),
-                             "webapps-notification-icon");
-
-        let progressMeter = chromeDoc.createElement("progressmeter");
-        progressMeter.setAttribute("mode", "undetermined");
-        popupProgressContent.appendChild(progressMeter);
-
-        let manifestURL = aData.app.manifestURL;
-
-        let nativeApp = new NativeApp(aData.app, jsonManifest,
-                                      aData.app.categories);
-
-        this.installations[manifestURL] = Promise.defer();
-        this.installations[manifestURL].promise.then(() => {
-          notifyInstallSuccess(aData.app, nativeApp, bundle,
-                               PrivateBrowsingUtils.isBrowserPrivate(aBrowser));
-        }, (error) => {
-          Cu.reportError("Error installing webapp: " + error);
-        }).then(() => {
-          popupProgressContent.removeChild(progressMeter);
-          delete this.installations[manifestURL];
-          if (Object.getOwnPropertyNames(this.installations).length == 0) {
-            notification.remove();
-          }
-        });
-
-        let localDir;
-        try {
-          localDir = nativeApp.createProfile();
-        } catch (ex) {
-          DOMApplicationRegistry.denyInstall(aData);
-          return;
-        }
-
-        DOMApplicationRegistry.confirmInstall(aData, localDir,
-          Task.async(function*(aApp, aManifest, aZipPath) {
-            try {
-              yield nativeApp.install(aApp, aManifest, aZipPath);
-            } catch (ex) {
-              Cu.reportError("Error installing webapp: " + ex);
-              throw ex;
-            }
-          })
-        );
-      }
-    };
-
-    let requestingURI = chromeWin.makeURI(aData.from);
-    let app = aData.app;
-    let manifest = new ManifestHelper(jsonManifest, app.origin, app.manifestURL);
-
-    let options = {
-      displayURI: requestingURI,
-    };
-
-    let message = bundle.getFormattedString("webapps.requestInstall2",
-                                            [manifest.name]);
-
-    let gBrowser = chromeWin.gBrowser;
-    if (gBrowser) {
-      let windowID = aData.oid;
-
-      let listener = {
-        onLocationChange(webProgress) {
-          if (webProgress.DOMWindowID == windowID) {
-            notification.remove();
-          }
-        }
-      };
-
-      gBrowser.addProgressListener(listener);
-
-      options.eventCallback = event => {
-        if (event != "removed") {
-          return;
-        }
-        // The notification was removed, so we should
-        // remove our listener.
-        gBrowser.removeProgressListener(listener);
-      };
-    }
-
-    notification = chromeWin.PopupNotifications.show(aBrowser,
-                                                     "webapps-install",
-                                                     message,
-                                                     "webapps-notification-icon",
-                                                     mainAction, [],
-                                                     options);
-  },
-
-  doUninstall: function(aData, aBrowser) {
-    let chromeDoc = aBrowser.ownerDocument;
-    let chromeWin = chromeDoc.defaultView;
-
-    let bundle = chromeWin.gNavigatorBundle;
-    let jsonManifest = aData.app.manifest;
-
-    let notification;
-
-    let mainAction = {
-      label: bundle.getString("webapps.uninstall"),
-      accessKey: bundle.getString("webapps.uninstall.accesskey"),
-      callback: () => {
-        notification.remove();
-        DOMApplicationRegistry.confirmUninstall(aData);
-      }
-    };
-
-    let secondaryAction = {
-      label: bundle.getString("webapps.doNotUninstall"),
-      accessKey: bundle.getString("webapps.doNotUninstall.accesskey"),
-      callback: () => {
-        notification.remove();
-        DOMApplicationRegistry.denyUninstall(aData, "USER_DECLINED");
-      }
-    };
-
-    let manifest = new ManifestHelper(jsonManifest, aData.app.origin,
-                                      aData.app.manifestURL);
-
-    let message = bundle.getFormattedString("webapps.requestUninstall",
-                                            [manifest.name]);
-
-
-    let options = {};
-    let gBrowser = chromeWin.gBrowser;
-    if (gBrowser) {
-      let windowID = aData.oid;
-
-      let listener = {
-        onLocationChange(webProgress) {
-          if (webProgress.DOMWindowID == windowID) {
-            notification.remove();
-          }
-        }
-      };
-
-      gBrowser.addProgressListener(listener);
-
-      options.eventCallback = event => {
-        if (event != "removed") {
-          return;
-        }
-        // The notification was removed, so we should
-        // remove our listener.
-        gBrowser.removeProgressListener(listener);
-      };
-    }
-
-    notification = chromeWin.PopupNotifications.show(
-                     aBrowser, "webapps-uninstall", message,
-                     "webapps-notification-icon",
-                     mainAction, [secondaryAction],
-                     options);
-  }
-}
-
-function notifyInstallSuccess(aApp, aNativeApp, aBundle, aInPrivateBrowsing) {
-  let launcher = {
-    observe: function(aSubject, aTopic) {
-      if (aTopic == "alertclickcallback") {
-        WebappOSUtils.launch(aApp);
-      }
-    }
-  };
-
-  try {
-    let notifier = Cc["@mozilla.org/alerts-service;1"].
-                   getService(Ci.nsIAlertsService);
-
-    notifier.showAlertNotification(aNativeApp.iconURI.spec,
-                                   aBundle.getString("webapps.install.success"),
-                                   aNativeApp.appNameAsFilename,
-                                   true, null, launcher, "", "", "", "", null,
-                                   aInPrivateBrowsing);
-  } catch (ex) {}
-}
--- a/browser/modules/moz.build
+++ b/browser/modules/moz.build
@@ -39,17 +39,16 @@ EXTRA_JS_MODULES += [
     'RemotePrompt.jsm',
     'Sanitizer.jsm',
     'SelfSupportBackend.jsm',
     'SitePermissions.jsm',
     'Social.jsm',
     'TabGroupsMigrator.jsm',
     'TransientPrefs.jsm',
     'UserContextUI.jsm',
-    'WebappManager.jsm',
     'webrtcUI.jsm',
 ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     EXTRA_JS_MODULES += [
         'Windows8WindowFrameColor.jsm',
         'WindowsJumpLists.jsm',
         'WindowsPreviewPerTab.jsm',
--- a/browser/themes/shared/notification-icons.inc.css
+++ b/browser/themes/shared/notification-icons.inc.css
@@ -57,21 +57,16 @@
 .popup-notification-icon[popupid="offline-app-usage"] {
   list-style-image: url(chrome://global/skin/icons/question-64.png);
 }
 
 .popup-notification-icon[popupid="password"] {
   list-style-image: url(chrome://mozapps/skin/passwordmgr/key-64.png);
 }
 
-.popup-notification-icon[popupid="webapps-install-progress"],
-.popup-notification-icon[popupid="webapps-install"] {
-  list-style-image: url(chrome://global/skin/icons/webapps-64.png);
-}
-
 .popup-notification-icon[popupid="webRTC-sharingDevices"],
 .popup-notification-icon[popupid="webRTC-shareDevices"] {
   list-style-image: url(chrome://browser/skin/webRTC-shareDevice-64.png);
 }
 
 .popup-notification-icon[popupid="webRTC-sharingMicrophone"],
 .popup-notification-icon[popupid="webRTC-shareMicrophone"] {
   list-style-image: url(chrome://browser/skin/webRTC-shareMicrophone-64.png);
@@ -154,21 +149,16 @@
 }
 
 #login-fill-notification-icon {
   /* Temporary icon until the capture and fill doorhangers are unified. */
   list-style-image: url(chrome://mozapps/skin/passwordmgr/key-16.png);
   transform: scaleX(-1);
 }
 
-.webapps-notification-icon,
-#webapps-notification-icon {
-  list-style-image: url(chrome://global/skin/icons/webapps-16.png);
-}
-
 #plugins-notification-icon {
   list-style-image: url(chrome://browser/skin/notification-pluginNormal.png);
 }
 
 #plugins-notification-icon.plugin-hidden {
   list-style-image: url(chrome://browser/skin/notification-pluginAlert.png);
 }
 
--- a/build/docs/test_manifests.rst
+++ b/build/docs/test_manifests.rst
@@ -26,19 +26,16 @@ browser.ini
    For the *browser chrome* flavor of mochitests.
 
 a11y.ini
    For the *a11y* flavor of mochitests.
 
 xpcshell.ini
    For *xpcshell* tests.
 
-webapprt.ini
-   For the *chrome* flavor of webapp runtime mochitests.
-
 .. _manifestparser_manifests:
 
 ManifestParser Manifests
 ==========================
 
 ManifestParser manifests are essentially ini files that conform to a basic
 set of assumptions.
 
--- a/build/gen_test_packages_manifest.py
+++ b/build/gen_test_packages_manifest.py
@@ -7,17 +7,16 @@
 import json
 
 from argparse import ArgumentParser
 
 ALL_HARNESSES = [
     'common', # Harnesses without a specific package will look here.
     'mochitest',
     'reftest',
-    'webapprt',
     'xpcshell',
     'cppunittest',
     'jittest',
     'mozbase',
     'web-platform',
     'talos',
     'gtest',
 ]
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -1545,19 +1545,16 @@ FREEZE_VARIABLES = \
 
 CHECK_FROZEN_VARIABLES = $(foreach var,$(FREEZE_VARIABLES), \
   $(if $(subst $($(var)_FROZEN),,'$($(var))'),$(error Makefile variable '$(var)' changed value after including rules.mk. Was $($(var)_FROZEN), now $($(var)).)))
 
 libs export::
 	$(CHECK_FROZEN_VARIABLES)
 
 PURGECACHES_DIRS ?= $(DIST)/bin
-ifdef MOZ_WEBAPP_RUNTIME
-PURGECACHES_DIRS += $(DIST)/bin/webapprt
-endif
 
 PURGECACHES_FILES = $(addsuffix /.purgecaches,$(PURGECACHES_DIRS))
 
 default all:: $(PURGECACHES_FILES)
 
 $(PURGECACHES_FILES):
 	if test -d $(@D) ; then touch $@ ; fi
 
--- a/devtools/shared/apps/tests/unit/head_apps.js
+++ b/devtools/shared/apps/tests/unit/head_apps.js
@@ -80,22 +80,16 @@ function setup() {
   Components.utils.import("resource://testing-common/AppInfo.jsm");
   updateAppInfo();
 
   // We have to toggle this flag in order to have apps being listed in getAll
   // as only launchable apps are returned
   Components.utils.import('resource://gre/modules/Webapps.jsm');
   DOMApplicationRegistry.allAppsLaunchable = true;
 
-  // Mock WebappOSUtils
-  Cu.import("resource://gre/modules/WebappOSUtils.jsm");
-  WebappOSUtils.getPackagePath = function(aApp) {
-    return aApp.basePath + "/" + aApp.id;
-  }
-
   // Enable launch/close method of the webapps actor
   let {WebappsActor} = require("devtools/server/actors/webapps");
   WebappsActor.prototype.supportsLaunch = true;
 }
 
 function do_get_webappsdir() {
   var webappsDir = Services.dirsvc.get("ProfD", Ci.nsILocalFile);
   webappsDir.append("test_webapps");
--- a/dom/apps/AppsUtils.jsm
+++ b/dom/apps/AppsUtils.jsm
@@ -11,19 +11,16 @@ const Cr = Components.results;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Promise.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
   "resource://gre/modules/FileUtils.jsm");
 
-XPCOMUtils.defineLazyModuleGetter(this, "WebappOSUtils",
-  "resource://gre/modules/WebappOSUtils.jsm");
-
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
   "resource://gre/modules/NetUtil.jsm");
 
 XPCOMUtils.defineLazyServiceGetter(this, "appsService",
                                    "@mozilla.org/AppsService;1",
                                    "nsIAppsService");
 
 // Shared code for AppsServiceChild.jsm, Webapps.jsm and Webapps.js
@@ -380,17 +377,17 @@ this.AppsUtils = {
     // from child process in mochitest.
     let prefName = "dom.mozApps.auto_confirm_install";
     if (Services.prefs.prefHasUserValue(prefName) &&
         Services.prefs.getBoolPref(prefName)) {
       return { "path": app.basePath + "/" + app.id,
                "isCoreApp": isCoreApp };
     }
 
-    return { "path": WebappOSUtils.getPackagePath(app),
+    return { "path": app.basePath + "/" + app.id,
              "isCoreApp": isCoreApp };
   },
 
   /**
     * Remove potential HTML tags from displayable fields in the manifest.
     * We check name, description, developer name, and permission description
     */
   sanitizeManifest: function(aManifest) {
--- a/dom/apps/Webapps.jsm
+++ b/dom/apps/Webapps.jsm
@@ -68,19 +68,16 @@ XPCOMUtils.defineLazyModuleGetter(this, 
   "resource://gre/modules/PermissionsInstaller.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "OfflineCacheInstaller",
   "resource://gre/modules/OfflineCacheInstaller.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "SystemMessagePermissionsChecker",
   "resource://gre/modules/SystemMessagePermissionsChecker.jsm");
 
-XPCOMUtils.defineLazyModuleGetter(this, "WebappOSUtils",
-  "resource://gre/modules/WebappOSUtils.jsm");
-
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
   "resource://gre/modules/NetUtil.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "ScriptPreloader",
                                   "resource://gre/modules/ScriptPreloader.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "Langpacks",
                                   "resource://gre/modules/Langpacks.jsm");
@@ -130,19 +127,17 @@ function supportUseCurrentProfile() {
 
 function supportSystemMessages() {
   return Services.prefs.getBoolPref("dom.sysmsg.enabled");
 }
 
 // Minimum delay between two progress events while downloading, in ms.
 const MIN_PROGRESS_EVENT_DELAY = 1500;
 
-const WEBAPP_RUNTIME = Services.appinfo.ID == "webapprt@mozilla.org";
-
-const chromeWindowType = WEBAPP_RUNTIME ? "webapprt:webapp" : "navigator:browser";
+const chromeWindowType = "navigator:browser";
 
 XPCOMUtils.defineLazyServiceGetter(this, "ppmm",
                                    "@mozilla.org/parentprocessmessagemanager;1",
                                    "nsIMessageBroadcaster");
 
 XPCOMUtils.defineLazyServiceGetter(this, "cpmm",
                                    "@mozilla.org/childprocessmessagemanager;1",
                                    "nsIMessageSender");
@@ -175,20 +170,18 @@ XPCOMUtils.defineLazyGetter(this, "permM
            .getService(Ci.nsIPermissionManager);
 });
 
 #ifdef MOZ_WIDGET_GONK
   const DIRECTORY_NAME = "webappsDir";
 #elifdef ANDROID
   const DIRECTORY_NAME = "webappsDir";
 #else
-  // If we're executing in the context of the webapp runtime, the data files
-  // are in a different directory (currently the Firefox profile that installed
-  // the webapp); otherwise, they're in the current profile.
-  const DIRECTORY_NAME = WEBAPP_RUNTIME ? "WebappRegD" : "ProfD";
+  // Mulet, B2G Desktop, etc.
+  const DIRECTORY_NAME = "ProfD";
 #endif
 
 // We'll use this to identify privileged apps that have been preinstalled
 // For those apps we'll set
 // STORE_ID_PENDING_PREFIX + installOrigin
 // as the storeID. This ensures it's unique and can't be set from a legit
 // store even by error.
 const STORE_ID_PENDING_PREFIX = "#unknownID#";
@@ -2993,17 +2986,17 @@ this.DOMApplicationRegistry = {
 
     if (aUpdateManifest && aUpdateManifest.size) {
       app.downloadSize = aUpdateManifest.size;
     }
 
     app.manifestHash = AppsUtils.computeHash(JSON.stringify(aUpdateManifest ||
                                                             aManifest));
 
-    let zipFile = WebappOSUtils.getPackagePath(app);
+    let zipFile = app.basePath + "/" + app.id;
     app.packageHash = yield this._computeFileHash(zipFile);
 
     app.role = aManifest.role || "";
     if (!AppsUtils.checkAppRole(app.role, app.appStatus)) {
       return;
     }
 
     app.redirects = this.sanitizeRedirects(aManifest.redirects);
@@ -4806,20 +4799,17 @@ this.DOMApplicationRegistry = {
   updateDataStoreEntriesFromLocalId: function(aLocalId) {
     let app = appsService.getAppByLocalId(aLocalId);
     if (app) {
       this.updateDataStoreForApp(app.id);
     }
   },
 
   _isLaunchable: function(aApp) {
-    if (this.allAppsLaunchable)
-      return true;
-
-    return WebappOSUtils.isLaunchable(aApp);
+    return true;
   },
 
   _notifyCategoryAndObservers: function(subject, topic, data,  msg) {
     const serviceMarker = "service,";
 
     // First create observers from the category manager.
     let cm =
       Cc["@mozilla.org/categorymanager;1"].getService(Ci.nsICategoryManager);
--- a/dom/apps/tests/test_bug_945152.html
+++ b/dom/apps/tests/test_bug_945152.html
@@ -14,29 +14,16 @@ https://bugzilla.mozilla.org/show_bug.cg
   const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
   SimpleTest.waitForExplicitFinish();
 
   const gBaseURL = 'http://test/chrome/dom/apps/tests/';
   const gSJS = gBaseURL + 'file_bug_945152.sjs';
   var gGenerator = runTest();
 
-  // When using SpecialPowers.autoConfirmAppInstall, it skips the local
-  // installation, and we need this mock to get correct package path.
-  Cu.import("resource://gre/modules/Services.jsm");
-  Cu.import("resource://gre/modules/WebappOSUtils.jsm");
-  var oldWebappOSUtils = WebappOSUtils;
-  WebappOSUtils.getPackagePath = function(aApp) {
-    return aApp.basePath + "/" + aApp.id;
-  }
-
-  SimpleTest.registerCleanupFunction(() => {
-    WebappOSUtils = oldWebappOSUtils;
-  });
-
   function go() {
      gGenerator.next();
   }
 
   function continueTest() {
     try { gGenerator.next(); }
     catch (e) { dump("Got exception: " + e + "\n"); }
   }
--- a/dom/apps/tests/test_packaged_app_asmjs.html
+++ b/dom/apps/tests/test_packaged_app_asmjs.html
@@ -18,30 +18,22 @@ const { classes: Cc, interfaces: Ci, uti
 
 SimpleTest.waitForExplicitFinish();
 
 const gBaseURL = 'http://test/chrome/dom/apps/tests/asmjs/';
 const gSJS = gBaseURL + 'asmjs_app.sjs';
 const gManifestURL = gSJS + '?getManifest=true';
 let gGenerator = runTest();
 
-// Mock WebappOSUtils
-Cu.import("resource://gre/modules/WebappOSUtils.jsm");
-let oldWebappOSUtils = WebappOSUtils;
-WebappOSUtils.getPackagePath = function(aApp) {
-  return aApp.basePath + "/" + aApp.id;
-}
-
 // Enable the ScriptPreloader module
 Cu.import("resource://gre/modules/ScriptPreloader.jsm");
 let oldScriptPreloaderEnabled = ScriptPreloader._enabled;
 ScriptPreloader._enabled = true;
 
 SimpleTest.registerCleanupFunction(() => {
-  WebappOSUtils = oldWebappOSUtils;
   ScriptPreloader._enabled = oldScriptPreloaderEnabled;
 });
 
 function go() {
   gGenerator.next();
 }
 
 function continueTest() {
--- a/old-configure.in
+++ b/old-configure.in
@@ -3616,17 +3616,16 @@ dnl ====================================
 
 MOZ_ARG_HEADER(Application)
 
 ENABLE_TESTS=1
 ENABLE_SYSTEM_EXTENSION_DIRS=1
 MOZ_BRANDING_DIRECTORY=
 MOZ_OFFICIAL_BRANDING=
 MOZ_FEEDS=1
-MOZ_WEBAPP_RUNTIME=
 MOZ_AUTH_EXTENSION=1
 if test "$MOZ_IOS"; then
    MOZ_AUTH_EXTENSION=
 fi
 MOZ_RAW=
 MOZ_VORBIS=
 MOZ_TREMOR=
 MOZ_SAMPLE_TYPE_FLOAT32=
@@ -6286,34 +6285,16 @@ if test "$OS_ARCH" = "WINNT"; then
       fi
     elif test -z "$CROSS_COMPILE"; then
       AC_MSG_ERROR([To build the installer you must have the latest MozillaBuild or NSIS version $MIN_NSIS_MAJOR_VER.$MIN_NSIS_MINOR_VER$MIN_NSIS_PRERELEASE_TYPE$MIN_NSIS_PRERELEASE_VER or greater in your path.])
     else
       MAKENSISU=
     fi
 fi
 
-dnl ========================================================
-dnl Web App Runtime
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(webapp-runtime,
-[  --disable-webapp-runtime  Disable Web App Runtime],
-    MOZ_WEBAPP_RUNTIME=,
-    MOZ_WEBAPP_RUNTIME=1)
-if test "$MOZ_WIDGET_TOOLKIT" != "windows" -a "$MOZ_WIDGET_TOOLKIT" != "cocoa" -a -z "$MOZ_WIDGET_GTK" ; then
-    MOZ_WEBAPP_RUNTIME=
-fi
-if test "$OS_ARCH" = "WINNT" -a -z "$MAKENSISU" -a -n "$CROSS_COMPILE"; then
-    MOZ_WEBAPP_RUNTIME=
-fi
-AC_SUBST(MOZ_WEBAPP_RUNTIME)
-if test "$MOZ_WEBAPP_RUNTIME"; then
-    AC_DEFINE(MOZ_WEBAPP_RUNTIME)
-fi
-
 AC_CHECK_PROGS(TAR, gnutar gtar tar, "")
 if test -z "$TAR"; then
     AC_MSG_ERROR([no tar archiver found in \$PATH])
 fi
 AC_SUBST(TAR)
 
 AC_CHECK_PROGS(WGET, wget, "")
 AC_SUBST(WGET)
--- a/python/mozbuild/mozbuild/artifacts.py
+++ b/python/mozbuild/mozbuild/artifacts.py
@@ -209,17 +209,16 @@ class LinuxArtifactJob(ArtifactJob):
         'firefox/application.ini',
         'firefox/crashreporter',
         'firefox/dependentlibs.list',
         'firefox/firefox',
         'firefox/firefox-bin',
         'firefox/platform.ini',
         'firefox/plugin-container',
         'firefox/updater',
-        'firefox/webapprt-stub',
         'firefox/**/*.so',
     }
 
     def process_package_artifact(self, filename, processed_filename):
         added_entry = False
 
         with JarWriter(file=processed_filename, optimize=False, compress_level=5) as writer:
             with tarfile.open(filename) as reader:
@@ -302,17 +301,16 @@ class MacArtifactJob(ArtifactJob):
             # These get copied into dist/bin with the path, so "root/a/b/c" -> "dist/bin/a/b/c".
             paths_keep_path = ('Contents/Resources', [
                 'browser/components/libbrowsercomps.dylib',
                 'dependentlibs.list',
                 # 'firefox',
                 'gmp-clearkey/0.1/libclearkey.dylib',
                 # 'gmp-fake/1.0/libfake.dylib',
                 # 'gmp-fakeopenh264/1.0/libfakeopenh264.dylib',
-                'webapprt-stub',
             ])
 
             with JarWriter(file=processed_filename, optimize=False, compress_level=5) as writer:
                 root, paths = paths_no_keep_path
                 finder = FileFinder(mozpath.join(source, root))
                 for path in paths:
                     for p, f in finder.find(path):
                         self.log(logging.INFO, 'artifact',
--- a/python/mozbuild/mozbuild/frontend/context.py
+++ b/python/mozbuild/mozbuild/frontend/context.py
@@ -1514,24 +1514,16 @@ VARIABLES = {
     'MOCHITEST_CHROME_MANIFESTS': (ManifestparserManifestList, list,
         """List of manifest files defining mochitest chrome tests.
         """),
 
     'MOCHITEST_MANIFESTS': (ManifestparserManifestList, list,
         """List of manifest files defining mochitest tests.
         """),
 
-    'MOCHITEST_WEBAPPRT_CONTENT_MANIFESTS': (ManifestparserManifestList, list,
-        """List of manifest files defining webapprt mochitest content tests.
-        """),
-
-    'MOCHITEST_WEBAPPRT_CHROME_MANIFESTS': (ManifestparserManifestList, list,
-        """List of manifest files defining webapprt mochitest chrome tests.
-        """),
-
     'REFTEST_MANIFESTS': (ReftestManifestList, list,
         """List of manifest files defining reftests.
 
         These are commonly named reftest.list.
         """),
 
     'CRASHTEST_MANIFESTS': (ReftestManifestList, list,
         """List of manifest files defining crashtests.
--- a/python/mozbuild/mozbuild/testing.py
+++ b/python/mozbuild/mozbuild/testing.py
@@ -177,20 +177,16 @@ class TestResolver(MozbuildObject):
             'jetpack-package': os.path.join(self.topobjdir, '_tests', 'testing',
                 'mochitest', 'jetpack-package'),
             'jetpack-addon': os.path.join(self.topobjdir, '_tests', 'testing',
                 'mochitest', 'jetpack-addon'),
             'chrome': os.path.join(self.topobjdir, '_tests', 'testing',
                 'mochitest', 'chrome'),
             'mochitest': os.path.join(self.topobjdir, '_tests', 'testing',
                 'mochitest', 'tests'),
-            'webapprt-chrome': os.path.join(self.topobjdir, '_tests', 'testing',
-                'mochitest', 'webapprtChrome'),
-            'webapprt-content': os.path.join(self.topobjdir, '_tests', 'testing',
-                'mochitest', 'webapprtContent'),
             'web-platform-tests': os.path.join(self.topobjdir, '_tests', 'testing',
                                                'web-platform'),
             'xpcshell': os.path.join(self.topobjdir, '_tests', 'xpcshell'),
         }
 
     def resolve_tests(self, cwd=None, **kwargs):
         """Resolve tests in the context of the current environment.
 
@@ -270,18 +266,16 @@ TEST_MANIFESTS = dict(
     MARIONETTE_LOOP=('marionette', 'marionette', '.', False),
     MARIONETTE_UNIT=('marionette', 'marionette', '.', False),
     MARIONETTE_UPDATE=('marionette', 'marionette', '.', False),
     MARIONETTE_WEBAPI=('marionette', 'marionette', '.', False),
 
     METRO_CHROME=('metro-chrome', 'testing/mochitest', 'metro', True),
     MOCHITEST=('mochitest', 'testing/mochitest', 'tests', True),
     MOCHITEST_CHROME=('chrome', 'testing/mochitest', 'chrome', True),
-    MOCHITEST_WEBAPPRT_CONTENT=('webapprt-content', 'testing/mochitest', 'webapprtContent', True),
-    MOCHITEST_WEBAPPRT_CHROME=('webapprt-chrome', 'testing/mochitest', 'webapprtChrome', True),
     WEBRTC_SIGNALLING_TEST=('steeplechase', 'steeplechase', '.', True),
     XPCSHELL_TESTS=('xpcshell', 'xpcshell', '.', True),
 )
 
 # Reftests have their own manifest format and are processed separately.
 REFTEST_FLAVORS = ('crashtest', 'reftest')
 
 # Web platform tests have their own manifest format and are processed separately.
--- a/python/mozbuild/mozpack/files.py
+++ b/python/mozbuild/mozpack/files.py
@@ -579,23 +579,23 @@ class XPTFile(GeneratedFile):
 
 
 class ManifestFile(BaseFile):
     '''
     File class for a manifest file. It takes individual manifest entries (using
     the add() and remove() member functions), and adjusts them to be relative
     to the base path for the manifest, given at creation.
     Example:
-        There is a manifest entry "content webapprt webapprt/content/" relative
-        to "webapprt/chrome". When packaging, the entry will be stored in
-        jar:webapprt/omni.ja!/chrome/chrome.manifest, which means the entry
-        will have to be relative to "chrome" instead of "webapprt/chrome". This
+        There is a manifest entry "content foobar foobar/content/" relative
+        to "foobar/chrome". When packaging, the entry will be stored in
+        jar:foobar/omni.ja!/chrome/chrome.manifest, which means the entry
+        will have to be relative to "chrome" instead of "foobar/chrome". This
         doesn't really matter when serializing the entry, since this base path
         is not written out, but it matters when moving the entry at the same
-        time, e.g. to jar:webapprt/omni.ja!/chrome.manifest, which we don't do
+        time, e.g. to jar:foobar/omni.ja!/chrome.manifest, which we don't do
         currently but could in the future.
     '''
     def __init__(self, base, entries=None):
         self._entries = entries if entries else []
         self._base = base
 
     def add(self, entry):
         '''
--- a/python/mozbuild/mozpack/test/test_packager_formats.py
+++ b/python/mozbuild/mozpack/test/test_packager_formats.py
@@ -301,24 +301,21 @@ def get_contents(registry, read_all=Fals
 
 class TestFormatters(unittest.TestCase):
     maxDiff = None
 
     def test_bases(self):
         formatter = FlatFormatter(FileRegistry())
         formatter.add_base('')
         formatter.add_base('browser')
-        formatter.add_base('webapprt')
         formatter.add_base('addon0', addon=True)
         self.assertEqual(formatter._get_base('platform.ini'),
                          ('', 'platform.ini'))
         self.assertEqual(formatter._get_base('browser/application.ini'),
                          ('browser', 'application.ini'))
-        self.assertEqual(formatter._get_base('webapprt/webapprt.ini'),
-                         ('webapprt', 'webapprt.ini'))
         self.assertEqual(formatter._get_base('addon0/install.rdf'),
                          ('addon0', 'install.rdf'))
 
     def do_test_contents(self, formatter, contents):
         for f in contents['files']:
             # .xpt files are merged, so skip them.
             if not f.endswith('.xpt'):
                 self.assertTrue(formatter.contains(f))
--- a/testing/mach_commands.py
+++ b/testing/mach_commands.py
@@ -150,20 +150,16 @@ TEST_FLAVORS = {
         'mach_command': 'reftest',
         'kwargs': {'tests': []}
     },
     'steeplechase': {},
     'web-platform-tests': {
         'mach_command': 'web-platform-tests',
         'kwargs': {'include': []}
     },
-    'webapprt-chrome': {
-        'mach_command': 'mochitest',
-        'kwargs': {'flavor': 'webapprt-chrome', 'test_paths': []},
-    },
     'xpcshell': {
         'mach_command': 'xpcshell-test',
         'kwargs': {'test_paths': []},
     },
 }
 
 for i in range(1, MOCHITEST_TOTAL_CHUNKS + 1):
     TEST_SUITES['mochitest-%d' %i] = {
--- a/testing/mochitest/browser-harness.xul
+++ b/testing/mochitest/browser-harness.xul
@@ -228,19 +228,17 @@
 
     function setStatus(aStatusString) {
       document.getElementById("status").value = aStatusString;
     }
 
     function createTester(links) {
       var windowMediator = Cc['@mozilla.org/appshell/window-mediator;1'].
                              getService(Ci.nsIWindowMediator);
-      var winType = gConfig.testRoot == "browser" ? "navigator:browser" :
-                    gConfig.testRoot == "webapprtChrome" ? "webapprt:webapp" :
-                    null;
+      var winType = gConfig.testRoot == "browser" ? "navigator:browser" : null;
       if (!winType) {
         throw new Error("Unrecognized gConfig.testRoot: " + gConfig.testRoot);
       }
       var testWin = windowMediator.getMostRecentWindow(winType);
 
       setStatus("Running...");
 
       // It's possible that the test harness window is not yet focused when this
--- a/testing/mochitest/browser-test.js
+++ b/testing/mochitest/browser-test.js
@@ -72,18 +72,17 @@ var TabDestroyObserver = {
     return new Promise((resolve) => {
       this.promiseResolver = resolve;
     });
   },
 };
 
 function testInit() {
   gConfig = readConfig();
-  if (gConfig.testRoot == "browser" ||
-      gConfig.testRoot == "webapprtChrome") {
+  if (gConfig.testRoot == "browser") {
     // Make sure to launch the test harness for the first opened window only
     var prefs = Services.prefs;
     if (prefs.prefHasUserValue("testing.browserTestHarness.running"))
       return;
 
     prefs.setBoolPref("testing.browserTestHarness.running", true);
 
     if (prefs.prefHasUserValue("testing.browserTestHarness.timeout"))
--- a/testing/mochitest/mach_commands.py
+++ b/testing/mochitest/mach_commands.py
@@ -120,85 +120,31 @@ ALL_FLAVORS = {
     'a11y': {
         'suite': 'a11y',
         'aliases': ('a11y', 'mochitest-a11y', 'accessibility'),
         'enabled_apps': ('firefox',),
         'extra_args': {
             'a11y': True,
         }
     },
-    'webapprt-chrome': {
-        'suite': 'webapprt-chrome',
-        'aliases': ('webapprt-chrome', 'mochitest-webapprt-chrome'),
-        'enabled_apps': ('firefox',),
-        'extra_args': {
-            'webapprtChrome': True,
-        }
-    },
-    'webapprt-content': {
-        'suite': 'webapprt-content',
-        'aliases': ('webapprt-content', 'mochitest-webapprt-content'),
-        'enabled_apps': ('firefox',),
-        'extra_args': {
-            'webapprtContent': True,
-        }
-    },
 }
 
 SUPPORTED_APPS = ['firefox', 'b2g', 'android', 'mulet']
 SUPPORTED_FLAVORS = list(chain.from_iterable([f['aliases'] for f in ALL_FLAVORS.values()]))
 CANONICAL_FLAVORS = sorted([f['aliases'][0] for f in ALL_FLAVORS.values()])
 
 
 class MochitestRunner(MozbuildObject):
 
     """Easily run mochitests.
 
     This currently contains just the basics for running mochitests. We may want
     to hook up result parsing, etc.
     """
 
-    def get_webapp_runtime_path(self):
-        import mozinfo
-        app_name = 'webapprt-stub' + mozinfo.info.get('bin_suffix', '')
-        app_path = os.path.join(self.distdir, 'bin', app_name)
-        if sys.platform.startswith('darwin'):
-            # On Mac, we copy the stub from the dist dir to the test app bundle,
-            # since we have to run it from a bundle for its windows to appear.
-            # Ideally, the build system would do this for us, and we should find
-            # a way for it to do that.
-            mac_dir_name = os.path.join(
-                self.mochitest_dir,
-                'webapprtChrome',
-                'webapprt',
-                'test',
-                'chrome',
-                'TestApp.app',
-                'Contents',
-                'MacOS')
-            mac_app_name = 'webapprt' + mozinfo.info.get('bin_suffix', '')
-            mac_app_path = os.path.join(mac_dir_name, mac_app_name)
-            shutil.copy(app_path, mac_app_path)
-            return mac_app_path
-        return app_path
-
-    # On Mac, the app invoked by runtests.py is in a different app bundle
-    # (as determined by get_webapp_runtime_path above), but the XRE path should
-    # still point to the browser's app bundle, so we set it here explicitly.
-    def get_webapp_runtime_xre_path(self):
-        if sys.platform.startswith('darwin'):
-            xre_path = os.path.join(
-                self.distdir,
-                self.substs['MOZ_MACBUNDLE_NAME'],
-                'Contents',
-                'Resources')
-        else:
-            xre_path = os.path.join(self.distdir, 'bin')
-        return xre_path
-
     def __init__(self, *args, **kwargs):
         MozbuildObject.__init__(self, *args, **kwargs)
 
         # TODO Bug 794506 remove once mach integrates with virtualenv.
         build_path = os.path.join(self.topobjdir, 'build')
         if build_path not in sys.path:
             sys.path.append(build_path)
 
@@ -252,18 +198,17 @@ class MochitestRunner(MozbuildObject):
             options.manifestFile = manifest
 
         return mochitest.run_test_harness(options)
 
     def run_desktop_test(self, context, tests=None, suite=None, **kwargs):
         """Runs a mochitest.
 
         suite is the type of mochitest to run. It can be one of ('plain',
-        'chrome', 'browser', 'a11y', 'jetpack-package', 'jetpack-addon',
-        'webapprt-chrome', 'webapprt-content').
+        'chrome', 'browser', 'a11y', 'jetpack-package', 'jetpack-addon').
         """
         # runtests.py is ambiguous, so we load the file/module manually.
         if 'mochitest' not in sys.modules:
             import imp
             path = os.path.join(self.mochitest_dir, 'runtests.py')
             with open(path, 'r') as fh:
                 imp.load_module('mochitest', fh, path,
                                 ('.py', 'r', imp.PY_SOURCE))
@@ -277,26 +222,16 @@ class MochitestRunner(MozbuildObject):
         # all logging to go through us, we just remove their handler.
         remove_handlers = [l for l in logging.getLogger().handlers
                            if isinstance(l, logging.StreamHandler)]
         for handler in remove_handlers:
             logging.getLogger().removeHandler(handler)
 
         options = Namespace(**kwargs)
 
-        if suite == 'webapprt-content':
-            if not options.app or options.app == self.get_binary_path():
-                options.app = self.get_webapp_runtime_path()
-            options.xrePath = self.get_webapp_runtime_xre_path()
-        elif suite == 'webapprt-chrome':
-            options.browserArgs.append("-test-mode")
-            if not options.app or options.app == self.get_binary_path():
-                options.app = self.get_webapp_runtime_path()
-            options.xrePath = self.get_webapp_runtime_xre_path()
-
         from manifestparser import TestManifest
         if tests:
             manifest = TestManifest()
             manifest.tests.extend(tests)
             options.manifestFile = manifest
 
             # When developing mochitest-plain tests, it's often useful to be able to
             # refresh the page to pick up modifications. Therefore leave the browser
@@ -661,16 +596,8 @@ class DeprecatedCommands(MachCommandBase
 
     @Command('jetpack-addon', category='testing', conditions=[REMOVED])
     def jetpack_addon(self):
         pass
 
     @Command('jetpack-package', category='testing', conditions=[REMOVED])
     def jetpack_package(self):
         pass
-
-    @Command('webapprt-test-chrome', category='testing', conditions=[REMOVED])
-    def webapprt_chrome(self):
-        pass
-
-    @Command('webapprt-test-content', category='testing', conditions=[REMOVED])
-    def webapprt_content(self):
-        pass
--- a/testing/mochitest/mochitest_options.py
+++ b/testing/mochitest/mochitest_options.py
@@ -228,30 +228,16 @@ class MochitestArguments(ArgumentContain
           }],
         [["--jetpack-addon"],
          {"action": "store_true",
           "dest": "jetpackAddon",
           "help": "Run jetpack addon tests.",
           "default": False,
           "suppress": True,
           }],
-        [["--webapprt-content"],
-         {"action": "store_true",
-          "dest": "webapprtContent",
-          "help": "Run WebappRT content tests.",
-          "default": False,
-          "suppress": True,
-          }],
-        [["--webapprt-chrome"],
-         {"action": "store_true",
-          "dest": "webapprtChrome",
-          "help": "Run WebappRT chrome tests.",
-          "default": False,
-          "suppress": True,
-          }],
         [["--a11y"],
          {"action": "store_true",
           "help": "Run accessibility Mochitests.",
           "default": False,
           "suppress": True,
           }],
         [["--setenv"],
          {"action": "append",
@@ -693,20 +679,16 @@ class MochitestArguments(ArgumentContain
         elif build_obj:
             options.certPath = os.path.join(build_obj.topsrcdir, 'build', 'pgo', 'certs')
 
         if options.symbolsPath and len(urlparse(options.symbolsPath).scheme) < 2:
             options.symbolsPath = self.get_full_path(options.symbolsPath, parser.oldcwd)
         elif not options.symbolsPath and build_obj:
             options.symbolsPath = os.path.join(build_obj.distdir, 'crashreporter-symbols')
 
-        if options.webapprtContent and options.webapprtChrome:
-            parser.error(
-                "Only one of --webapprt-content and --webapprt-chrome may be given.")
-
         if options.jsdebugger:
             options.extraPrefs += [
                 "devtools.debugger.remote-enabled=true",
                 "devtools.chrome.enabled=true",
                 "devtools.debugger.prompt-connection=false"
             ]
             options.autorun = False
 
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -363,18 +363,17 @@ class MochitestServer(object):
         self._utilityPath = options['utilityPath']
         self._xrePath = options['xrePath']
         self._profileDir = options['profilePath']
         self.webServer = options['webServer']
         self.httpPort = options['httpPort']
         self.shutdownURL = "http://%(server)s:%(port)s/server/shutdown" % {
             "server": self.webServer,
             "port": self.httpPort}
-        self.testPrefix = "'webapprt_'" if options.get(
-            'webapprtContent') else "undefined"
+        self.testPrefix = "undefined"
 
         if options.get('httpdPath'):
             self._httpdPath = options['httpdPath']
         else:
             self._httpdPath = SCRIPT_DIR
         self._httpdPath = os.path.abspath(self._httpdPath)
 
     def start(self):
@@ -609,30 +608,27 @@ class MochitestBase(object):
         if not hasattr(options, 'fileLevel'):
             options.fileLevel = 'INFO'
 
         # allow relative paths for logFile
         if options.logFile:
             options.logFile = self.getLogFilePath(options.logFile)
 
         if options.browserChrome or options.chrome or \
-           options.a11y or options.webapprtChrome or options.jetpackPackage or \
-           options.jetpackAddon:
+           options.a11y or options.jetpackPackage or options.jetpackAddon:
             self.makeTestConfig(options)
         else:
             if options.autorun:
                 self.urlOpts.append("autorun=1")
             if options.timeout:
                 self.urlOpts.append("timeout=%d" % options.timeout)
             if options.maxTimeouts:
                 self.urlOpts.append("maxTimeouts=%d" % options.maxTimeouts)
             if not options.keep_open:
                 self.urlOpts.append("closeWhenDone=1")
-            if options.webapprtContent:
-                self.urlOpts.append("testRoot=webapprtContent")
             if options.logFile:
                 self.urlOpts.append(
                     "logFile=" +
                     encodeURIComponent(
                         options.logFile))
                 self.urlOpts.append(
                     "fileLevel=" +
                     encodeURIComponent(
@@ -692,41 +688,32 @@ class MochitestBase(object):
         elif options.jetpackPackage:
             return "jetpack-package"
         elif options.jetpackAddon:
             return "jetpack-addon"
         elif options.chrome:
             return "chrome"
         elif options.a11y:
             return "a11y"
-        elif options.webapprtChrome:
-            return "webapprt-chrome"
-        elif options.webapprtContent:
-            return "webapprt-content"
         else:
             return "mochitest"
 
     # This check can be removed when bug 983867 is fixed.
     def isTest(self, options, filename):
         allow_js_css = False
         if options.browserChrome:
             allow_js_css = True
             testPattern = re.compile(r"browser_.+\.js")
         elif options.jetpackPackage:
             allow_js_css = True
             testPattern = re.compile(r"test-.+\.js")
         elif options.jetpackAddon:
             testPattern = re.compile(r".+\.xpi")
         elif options.chrome or options.a11y:
             testPattern = re.compile(r"(browser|test)_.+\.(xul|html|js|xhtml)")
-        elif options.webapprtContent:
-            testPattern = re.compile(r"webapprt_")
-        elif options.webapprtChrome:
-            allow_js_css = True
-            testPattern = re.compile(r"browser_")
         else:
             testPattern = re.compile(r"test_")
 
         if not allow_js_css and (".js" in filename or ".css" in filename):
             return False
 
         pathPieces = filename.split("/")
 
@@ -740,20 +727,16 @@ class MochitestBase(object):
             else:
                 self.testRoot = 'browser'
         elif options.jetpackPackage:
             self.testRoot = 'jetpack-package'
         elif options.jetpackAddon:
             self.testRoot = 'jetpack-addon'
         elif options.a11y:
             self.testRoot = 'a11y'
-        elif options.webapprtChrome:
-            self.testRoot = 'webapprtChrome'
-        elif options.webapprtContent:
-            self.testRoot = 'webapprtContent'
         elif options.chrome:
             self.testRoot = 'chrome'
         else:
             self.testRoot = self.TEST_PATH
         self.testRootAbs = os.path.join(SCRIPT_DIR, self.testRoot)
 
     def buildTestURL(self, options):
         testHost = "http://mochi.test:8888"
@@ -2161,17 +2144,17 @@ class MochitestDesktop(MochitestBase):
         # we still see infrequent cases where a process is orphaned and interferes
         # with future tests, typically because the old server is keeping the port in use.
         # Try to avoid those failures by checking for and killing orphan servers before
         # trying to start new ones.
         self.killNamedOrphans('ssltunnel')
         self.killNamedOrphans('xpcshell')
 
         # Until we have all green, this only runs on bc*/dt*/mochitest-chrome
-        # jobs, not webapprt*, jetpack*, a11yr (for perf reasons), or plain
+        # jobs, not jetpack*, a11yr (for perf reasons), or plain
 
         testsToRun = self.getTestsToRun(options)
         if not options.runByDir:
             return self.runMochitests(options, testsToRun)
 
         # code for --run-by-dir
         dirs = self.getDirectories(options)
 
@@ -2310,25 +2293,16 @@ class MochitestDesktop(MochitestBase):
                     count += 1
                 if count == 0:
                     return 1
 
             self.buildURLOptions(options, self.browserEnv)
             if self.urlOpts:
                 testURL += "?" + "&".join(self.urlOpts)
 
-            # On Mac, pass the path to the runtime, to ensure the test app
-            # uses that specific runtime instead of another one on the system.
-            if mozinfo.isMac and options.webapprtChrome:
-                options.browserArgs.extend(('-runtime', os.path.dirname(os.path.dirname(options.xrePath))))
-
-            if options.webapprtContent:
-                options.browserArgs.extend(('-test-mode', testURL))
-                testURL = None
-
             if options.immersiveMode:
                 options.browserArgs.extend(('-firefoxpath', options.app))
                 options.app = self.immersiveHelperPath
 
             if options.jsdebugger:
                 options.browserArgs.extend(['-jsdebugger'])
 
             # Remove the leak detection file so it can't "leak" to the tests run.
@@ -2342,17 +2316,17 @@ class MochitestDesktop(MochitestBase):
                 timeout = options.timeout + 30
             elif options.debugger or not options.autorun:
                 timeout = None
             else:
                 timeout = 330.0  # default JS harness timeout is 300 seconds
 
             # detect shutdown leaks for m-bc runs
             detectShutdownLeaks = mozinfo.info[
-                "debug"] and options.browserChrome and not options.webapprtChrome
+                "debug"] and options.browserChrome
 
             self.start_script_args.append(self.getTestFlavor(options))
             marionette_args = {
                 'symbols_path': options.symbolsPath,
                 'socket_timeout': options.marionette_socket_timeout,
                 'port_timeout': options.marionette_port_timeout,
             }
 
--- a/testing/mochitest/tests/SimpleTest/SimpleTest.js
+++ b/testing/mochitest/tests/SimpleTest/SimpleTest.js
@@ -602,17 +602,16 @@ SimpleTest._originalSetTimeout = window.
 window.setTimeout = function SimpleTest_setTimeoutShim() {
     // Don't break tests that are loaded without a parent runner.
     if (parentRunner) {
         // Right now, we only enable these checks for mochitest-plain.
         switch (SimpleTest.harnessParameters.testRoot) {
         case "browser":
         case "chrome":
         case "a11y":
-        case "webapprtContent":
             break;
         default:
             if (!SimpleTest._alreadyFinished && arguments.length > 1 && arguments[1] > 0) {
                 if (SimpleTest._flakyTimeoutIsOK) {
                     SimpleTest.todo(false, "The author of the test has indicated that flaky timeouts are expected.  Reason: " + SimpleTest._flakyTimeoutReason);
                 } else {
                     SimpleTest.ok(false, "Test attempted to use a flaky timeout value " + arguments[1]);
                 }
--- a/testing/mochitest/tests/SimpleTest/setup.js
+++ b/testing/mochitest/tests/SimpleTest/setup.js
@@ -76,18 +76,16 @@ if (config.testRoot == "chrome" || confi
 }
 
 if (params.testRoot == "browser") {
   params.testPrefix = "chrome://mochitests/content/browser/";
 } else if (params.testRoot == "chrome") {
   params.testPrefix = "chrome://mochitests/content/chrome/";
 } else if (params.testRoot == "a11y") {
   params.testPrefix = "chrome://mochitests/content/a11y/";
-} else if (params.testRoot == "webapprtContent") {
-  params.testPrefix = "/webapprtContent/";
 } else {
   params.testPrefix = "/tests/";
 }
 
 // set the per-test timeout if specified in the query string
 if (params.timeout) {
   TestRunner.timeout = parseInt(params.timeout) * 1000;
 }
--- a/testing/mozharness/configs/unittests/linux_unittest.py
+++ b/testing/mozharness/configs/unittests/linux_unittest.py
@@ -43,17 +43,16 @@ config = {
     "pip_index": False,
     ###
     "installer_path": INSTALLER_PATH,
     "binary_path": BINARY_PATH,
     "xpcshell_name": XPCSHELL_NAME,
     "exe_suffix": EXE_SUFFIX,
     "run_file_names": {
         "mochitest": "runtests.py",
-        "webapprt": "runtests.py",
         "reftest": "runreftest.py",
         "xpcshell": "runxpcshelltests.py",
         "cppunittest": "runcppunittests.py",
         "gtest": "rungtests.py",
         "jittest": "jit_test.py",
         "mozbase": "test.py",
         "mozmill": "runtestlist.py",
     },
@@ -63,17 +62,16 @@ config = {
         "config/*",
         "marionette/*",
         "modules/*",
         "mozbase/*",
         "tools/*",
     ],
     "specific_tests_zip_dirs": {
         "mochitest": ["mochitest/*"],
-        "webapprt": ["mochitest/*"],
         "reftest": ["reftest/*", "jsreftest/*"],
         "xpcshell": ["xpcshell/*"],
         "cppunittest": ["cppunittest/*"],
         "gtest": ["gtest/*"],
         "jittest": ["jit-test/*"],
         "mozbase": ["mozbase/*"],
         "mozmill": ["mozmill/*"],
     },
@@ -160,30 +158,16 @@ config = {
                 "--extra-profile-file=tests/bin/plugins",
                 "--symbols-path=%(symbols_path)s",
                 "--log-raw=%(raw_log_file)s",
                 "--log-errorsummary=%(error_summary_file)s",
             ],
             "run_filename": "runreftest.py",
             "testsdir": "reftest"
         },
-        "webapprt": {
-            "options": [
-                "--app=%(app_path)s",
-                "--utility-path=tests/bin",
-                "--extra-profile-file=tests/bin/plugins",
-                "--symbols-path=%(symbols_path)s",
-                "--certificate-path=tests/certs",
-                "--console-level=INFO",
-                "--testing-modules-dir=tests/modules",
-                "--quiet"
-            ],
-            "run_filename": "runtests.py",
-            "testsdir": "mochitest"
-        },
         "xpcshell": {
             "options": [
                 "--symbols-path=%(symbols_path)s",
                 "--test-plugin-path=%(test_plugin_path)s",
                 "--log-raw=%(raw_log_file)s",
                 "--log-errorsummary=%(error_summary_file)s",
                 "--utility-path=tests/bin",
             ],
@@ -219,21 +203,16 @@ config = {
         "browser-chrome-screenshots": ["--browser-chrome", "--subsuite=screenshots"],
         "mochitest-gl": ["--subsuite=webgl"],
         "mochitest-devtools-chrome": ["--browser-chrome", "--subsuite=devtools"],
         "mochitest-devtools-chrome-chunked": ["--browser-chrome", "--subsuite=devtools", "--chunk-by-runtime"],
         "jetpack-package": ["--jetpack-package"],
         "jetpack-addon": ["--jetpack-addon"],
         "a11y": ["--a11y"],
     },
-    # local webapprt suites
-    "all_webapprt_suites": {
-        "chrome": ["--webapprt-chrome", "--browser-arg=-test-mode"],
-        "content": ["--webapprt-content"]
-    },
     # local reftest suites
     "all_reftest_suites": {
         "reftest": {
             "options": ["--suite=reftest"],
             "tests": ["tests/reftest/tests/layout/reftests/reftest.list"]
         },
         "crashtest": {
             "options": ["--suite=crashtest"],
--- a/testing/mozharness/configs/unittests/mac_unittest.py
+++ b/testing/mozharness/configs/unittests/mac_unittest.py
@@ -20,17 +20,16 @@ config = {
     ],
     "pip_index": False,
     ###
     "installer_path": INSTALLER_PATH,
     "xpcshell_name": XPCSHELL_NAME,
     "exe_suffix": EXE_SUFFIX,
     "run_file_names": {
         "mochitest": "runtests.py",
-        "webapprt": "runtests.py",
         "reftest": "runreftest.py",
         "xpcshell": "runxpcshelltests.py",
         "cppunittest": "runcppunittests.py",
         "gtest": "rungtests.py",
         "jittest": "jit_test.py",
         "mozbase": "test.py",
         "mozmill": "runtestlist.py",
     },
@@ -40,17 +39,16 @@ config = {
         "config/*",
         "marionette/*",
         "modules/*",
         "mozbase/*",
         "tools/*",
     ],
     "specific_tests_zip_dirs": {
         "mochitest": ["mochitest/*"],
-        "webapprt": ["mochitest/*"],
         "reftest": ["reftest/*", "jsreftest/*"],
         "xpcshell": ["xpcshell/*"],
         "cppunittest": ["cppunittest/*"],
         "gtest": ["gtest/*"],
         "jittest": ["jit-test/*"],
         "mozbase": ["mozbase/*"],
         "mozmill": ["mozmill/*"],
     },
@@ -112,31 +110,16 @@ config = {
                 "--appname=%(binary_path)s",
                 "--utility-path=tests/bin",
                 "--extra-profile-file=tests/bin/plugins",
                 "--symbols-path=%(symbols_path)s"
             ],
             "run_filename": "runreftest.py",
             "testsdir": "reftest"
         },
-        "webapprt": {
-            "options": [
-                "--app=%(app_path)s",
-                "--xre-path=%(abs_res_dir)s",
-                "--utility-path=tests/bin",
-                "--extra-profile-file=tests/bin/plugins",
-                "--symbols-path=%(symbols_path)s",
-                "--certificate-path=tests/certs",
-                "--console-level=INFO",
-                "--testing-modules-dir=tests/modules",
-                "--quiet"
-            ],
-            "run_filename": "runtests.py",
-            "testsdir": "mochitest"
-        },
         "xpcshell": {
             "options": [
                 "--symbols-path=%(symbols_path)s",
                 "--test-plugin-path=%(test_plugin_path)s",
                 "--log-raw=%(raw_log_file)s",
                 "--log-errorsummary=%(error_summary_file)s",
                 "--utility-path=tests/bin",
             ],
@@ -167,21 +150,16 @@ config = {
         "browser-chrome-screenshots": ["--browser-chrome", "--subsuite=screenshots"],
         "mochitest-gl": ["--subsuite=webgl"],
         "mochitest-devtools-chrome": ["--browser-chrome", "--subsuite=devtools"],
         "mochitest-devtools-chrome-chunked": ["--browser-chrome", "--subsuite=devtools", "--chunk-by-runtime"],
         "jetpack-package": ["--jetpack-package"],
         "jetpack-addon": ["--jetpack-addon"],
         "a11y": ["--a11y"],
     },
-    # local webapprt suites
-    "all_webapprt_suites": {
-        "chrome": ["--webapprt-chrome", "--browser-arg=-test-mode"],
-        "content": ["--webapprt-content"]
-    },
     # local reftest suites
     "all_reftest_suites": {
         "reftest": {
             'options': ["--suite=reftest"],
             'tests': ["tests/reftest/tests/layout/reftests/reftest.list"]
         },
         "crashtest": {
             'options': ["--suite=crashtest"],
--- a/testing/mozharness/configs/unittests/win_unittest.py
+++ b/testing/mozharness/configs/unittests/win_unittest.py
@@ -29,17 +29,16 @@ config = {
     "find_links": [
         "http://pypi.pvt.build.mozilla.org/pub",
         "http://pypi.pub.build.mozilla.org/pub",
     ],
     "pip_index": False,
     "exe_suffix": EXE_SUFFIX,
     "run_file_names": {
         "mochitest": "runtests.py",
-        "webapprt": "runtests.py",
         "reftest": "runreftest.py",
         "xpcshell": "runxpcshelltests.py",
         "cppunittest": "runcppunittests.py",
         "gtest": "rungtests.py",
         "jittest": "jit_test.py",
         "mozbase": "test.py",
         "mozmill": "runtestlist.py",
     },
@@ -49,17 +48,16 @@ config = {
         "config/*",
         "marionette/*",
         "modules/*",
         "mozbase/*",
         "tools/*",
     ],
     "specific_tests_zip_dirs": {
         "mochitest": ["mochitest/*"],
-        "webapprt": ["mochitest/*"],
         "reftest": ["reftest/*", "jsreftest/*"],
         "xpcshell": ["xpcshell/*"],
         "cppunittest": ["cppunittest/*"],
         "gtest": ["gtest/*"],
         "jittest": ["jit-test/*"],
         "mozbase": ["mozbase/*"],
         "mozmill": ["mozmill/*"],
     },
@@ -123,30 +121,16 @@ config = {
                 "--extra-profile-file=tests/bin/plugins",
                 "--symbols-path=%(symbols_path)s",
                 "--log-raw=%(raw_log_file)s",
                 "--log-errorsummary=%(error_summary_file)s",
             ],
             "run_filename": "runreftest.py",
             "testsdir": "reftest"
         },
-        "webapprt": {
-            "options": [
-                "--app=%(app_path)s",
-                "--utility-path=tests/bin",
-                "--extra-profile-file=tests/bin/plugins",
-                "--symbols-path=%(symbols_path)s",
-                "--certificate-path=tests/certs",
-                "--console-level=INFO",
-                "--testing-modules-dir=tests/modules",
-                "--quiet"
-            ],
-            "run_filename": "runtests.py",
-            "testsdir": "mochitest"
-        },
         "xpcshell": {
             "options": [
                 "--symbols-path=%(symbols_path)s",
                 "--test-plugin-path=%(test_plugin_path)s",
                 "--log-raw=%(raw_log_file)s",
                 "--log-errorsummary=%(error_summary_file)s",
                 "--utility-path=tests/bin",
             ],
@@ -179,21 +163,16 @@ config = {
         "mochitest-gl": ["--subsuite=webgl"],
         "mochitest-devtools-chrome": ["--browser-chrome", "--subsuite=devtools"],
         "mochitest-devtools-chrome-chunked": ["--browser-chrome", "--subsuite=devtools", "--chunk-by-runtime"],
         "mochitest-metro-chrome": ["--browser-chrome", "--metro-immersive"],
         "jetpack-package": ["--jetpack-package"],
         "jetpack-addon": ["--jetpack-addon"],
         "a11y": ["--a11y"],
     },
-    # local webapprt suites
-    "all_webapprt_suites": {
-        "chrome": ["--webapprt-chrome", "--browser-arg=-test-mode"],
-        "content": ["--webapprt-content"]
-    },
     # local reftest suites
     "all_reftest_suites": {
         "reftest": {
             'options': ["--suite=reftest"],
             'tests': ["tests/reftest/tests/layout/reftests/reftest.list"]
         },
         "crashtest": {
             'options': ["--suite=crashtest"],
--- a/testing/mozharness/mach_commands.py
+++ b/testing/mozharness/mach_commands.py
@@ -108,26 +108,16 @@ class MozharnessRunner(MozbuildObject):
                 "config": desktop_unittest_config + [
                     "--reftest-suite", "crashtest-ipc"]
             },
             "cppunittest": {
                 "script": "desktop_unittest.py",
                 "config": desktop_unittest_config + [
                     "--cppunittest-suite", "cppunittest"]
             },
-            "webapprt-chrome": {
-                "script": "desktop_unittest.py",
-                "config": desktop_unittest_config + [
-                    "--webapprt-suite", "chrome"]
-            },
-            "webapprt-content": {
-                "script": "desktop_unittest.py",
-                "config": desktop_unittest_config + [
-                    "--webapprt-suite", "content"]
-            },
             "xpcshell": {
                 "script": "desktop_unittest.py",
                 "config": desktop_unittest_config + [
                     "--xpcshell-suite", "xpcshell"]
             },
             "xpcshell-addons": {
                 "script": "desktop_unittest.py",
                 "config": desktop_unittest_config + [
--- a/testing/mozharness/mozharness/mozilla/testing/errors.py
+++ b/testing/mozharness/mozharness/mozilla/testing/errors.py
@@ -79,17 +79,16 @@ TinderBoxPrintRe = {
         'known_fail_group': None,
     },
     "mozmill_summary": {
         'regex': re.compile(r'''INFO (Passed|Failed|Skipped): (\d+)'''),
         'pass_group': "Passed",
         'fail_group': "Failed",
         'known_fail_group': "Skipped",
     },
-    "webapprt_summary": _mochitest_summary,
 
     "harness_error": {
         'full_regex': re.compile(r"(?:TEST-UNEXPECTED-FAIL|PROCESS-CRASH) \| .* \| (application crashed|missing output line for total leaks!|negative leaks caught!|\d+ bytes leaked)"),
         'minimum_regex': re.compile(r'''(TEST-UNEXPECTED|PROCESS-CRASH)'''),
         'retry_regex': re.compile(r'''FAIL-SHOULD-RETRY''')
     },
 }
 
--- a/testing/mozharness/mozharness/mozilla/testing/testbase.py
+++ b/testing/mozharness/mozharness/mozilla/testing/testbase.py
@@ -430,17 +430,16 @@ 2. running via buildbot and running the 
     def _download_test_packages(self, suite_categories, target_unzip_dirs):
         # Some platforms define more suite categories/names than others.
         # This is a difference in the convention of the configs more than
         # to how these tests are run, so we pave over these differences here.
         aliases = {
             'robocop': 'mochitest',
             'mochitest-chrome': 'mochitest',
             'mochitest-gl': 'mochitest',
-            'webapprt': 'mochitest',
             'jsreftest': 'reftest',
             'crashtest': 'reftest',
             'reftest-debug': 'reftest',
             'jsreftest-debug': 'reftest',
             'crashtest-debug': 'reftest',
         }
         suite_categories = [aliases.get(name, name) for name in suite_categories]
 
--- a/testing/mozharness/scripts/desktop_unittest.py
+++ b/testing/mozharness/scripts/desktop_unittest.py
@@ -27,37 +27,29 @@ from mozharness.base.vcs.vcsbase import 
 from mozharness.mozilla.blob_upload import BlobUploadMixin, blobupload_config_options
 from mozharness.mozilla.mozbase import MozbaseMixin
 from mozharness.mozilla.testing.codecoverage import (
     CodeCoverageMixin,
     code_coverage_config_options
 )
 from mozharness.mozilla.testing.testbase import TestingMixin, testing_config_options
 
-SUITE_CATEGORIES = ['gtest', 'cppunittest', 'jittest', 'mochitest', 'reftest', 'xpcshell', 'mozbase', 'mozmill', 'webapprt']
+SUITE_CATEGORIES = ['gtest', 'cppunittest', 'jittest', 'mochitest', 'reftest', 'xpcshell', 'mozbase', 'mozmill']
 
 # DesktopUnittest {{{1
 class DesktopUnittest(TestingMixin, MercurialScript, BlobUploadMixin, MozbaseMixin, CodeCoverageMixin):
     config_options = [
         [['--mochitest-suite', ], {
             "action": "extend",
             "dest": "specified_mochitest_suites",
             "type": "string",
             "help": "Specify which mochi suite to run. "
                     "Suites are defined in the config file.\n"
                     "Examples: 'all', 'plain1', 'plain5', 'chrome', or 'a11y'"}
          ],
-        [['--webapprt-suite', ], {
-            "action": "extend",
-            "dest": "specified_webapprt_suites",
-            "type": "string",
-            "help": "Specify which webapprt suite to run. "
-                    "Suites are defined in the config file.\n"
-                    "Examples: 'content', 'chrome'"}
-         ],
         [['--reftest-suite', ], {
             "action": "extend",
             "dest": "specified_reftest_suites",
             "type": "string",
             "help": "Specify which reftest suite to run. "
                     "Suites are defined in the config file.\n"
                     "Examples: 'all', 'crashplan', or 'jsreftest'"}
          ],
@@ -204,17 +196,16 @@ class DesktopUnittest(TestingMixin, Merc
         dirs['abs_test_install_dir'] = os.path.join(abs_dirs['abs_work_dir'], 'tests')
         dirs['abs_test_extensions_dir'] = os.path.join(dirs['abs_test_install_dir'], 'extensions')
         dirs['abs_test_bin_dir'] = os.path.join(dirs['abs_test_install_dir'], 'bin')
         dirs['abs_test_bin_plugins_dir'] = os.path.join(dirs['abs_test_bin_dir'],
                                                         'plugins')
         dirs['abs_test_bin_components_dir'] = os.path.join(dirs['abs_test_bin_dir'],
                                                            'components')
         dirs['abs_mochitest_dir'] = os.path.join(dirs['abs_test_install_dir'], "mochitest")
-        dirs['abs_webapprt_dir'] = os.path.join(dirs['abs_test_install_dir'], "mochitest")
         dirs['abs_reftest_dir'] = os.path.join(dirs['abs_test_install_dir'], "reftest")
         dirs['abs_xpcshell_dir'] = os.path.join(dirs['abs_test_install_dir'], "xpcshell")
         dirs['abs_cppunittest_dir'] = os.path.join(dirs['abs_test_install_dir'], "cppunittest")
         dirs['abs_gtest_dir'] = os.path.join(dirs['abs_test_install_dir'], "gtest")
         dirs['abs_blob_upload_dir'] = os.path.join(abs_dirs['abs_work_dir'], 'blobber_upload_dir')
         dirs['abs_jittest_dir'] = os.path.join(dirs['abs_test_install_dir'], "jit-test", "jit-test")
         dirs['abs_mozbase_dir'] = os.path.join(dirs['abs_test_install_dir'], "mozbase")
         dirs['abs_mozmill_dir'] = os.path.join(dirs['abs_test_install_dir'], "mozmill")
@@ -292,42 +283,16 @@ class DesktopUnittest(TestingMixin, Merc
                 self.fatal("self.installer_url was found but symbols_url could \
                         not be determined")
         else:
             self.fatal("self.installer_url was not found in self.config")
         self.info("setting symbols_url as %s" % (symbols_url))
         self.symbols_url = symbols_url
         return self.symbols_url
 
-    def get_webapprt_path(self, res_dir, mochitest_dir):
-        """Get the path to the webapp runtime binary.
-        On Mac, we copy the stub from the resources dir to the test app bundle,
-        since we have to run it from the executable directory of a bundle
-        in order for its windows to appear.  Ideally, the build system would do
-        this for us at build time, and we should find a way for it to do that.
-        """
-        exe_suffix = self.config.get('exe_suffix', '')
-        app_name = 'webapprt-stub' + exe_suffix
-        app_path = os.path.join(res_dir, app_name)
-        if self._is_darwin():
-            mac_dir_name = os.path.join(
-                mochitest_dir,
-                'webapprtChrome',
-                'webapprt',
-                'test',
-                'chrome',
-                'TestApp.app',
-                'Contents',
-                'MacOS')
-            mac_app_name = 'webapprt' + exe_suffix
-            mac_app_path = os.path.join(mac_dir_name, mac_app_name)
-            self.copyfile(app_path, mac_app_path, copystat=True)
-            return mac_app_path
-        return app_path
-
     def _query_abs_base_cmd(self, suite_category, suite):
         if self.binary_path:
             c = self.config
             dirs = self.query_abs_dirs()
             run_file = c['run_file_names'][suite_category]
             base_cmd = [self.query_python_path('python'), '-u']
             base_cmd.append(os.path.join(dirs["abs_%s_dir" % suite_category], run_file))
             abs_app_dir = self.query_abs_app_dir()
@@ -349,19 +314,16 @@ class DesktopUnittest(TestingMixin, Merc
                                           'gtest'),
             }
 
             # TestingMixin._download_and_extract_symbols() will set
             # self.symbols_path when downloading/extracting.
             if self.symbols_path:
                 str_format_values['symbols_path'] = self.symbols_path
 
-            if suite_category == 'webapprt':
-                str_format_values['app_path'] = self.get_webapprt_path(abs_res_dir, dirs['abs_mochitest_dir'])
-
             if c['e10s']:
                 base_cmd.append('--e10s')
 
             if c.get('strict_content_sandbox'):
                 if suite_category == "mochitest":
                     base_cmd.append('--strict-content-sandbox')
                 else:
                     self.fatal("--strict-content-sandbox only works with mochitest suites.")
@@ -492,17 +454,16 @@ class DesktopUnittest(TestingMixin, Merc
                                                           suite_categories=target_categories)
 
     # pull defined in VCSScript.
     # preflight_run_tests defined in TestingMixin.
 
     def run_tests(self):
         self._run_category_suites('mochitest')
         self._run_category_suites('reftest')
-        self._run_category_suites('webapprt')
         self._run_category_suites('xpcshell',
                                   preflight_run_method=self.preflight_xpcshell)
         self._run_category_suites('cppunittest',
                                   preflight_run_method=self.preflight_cppunittest)
         self._run_category_suites('gtest',
                                   preflight_run_method=self.preflight_gtest)
         self._run_category_suites('jittest')
         self._run_category_suites('mozbase')
--- a/toolkit/moz.build
+++ b/toolkit/moz.build
@@ -14,17 +14,16 @@ DIRS += [
     'mozapps/downloads',
     'mozapps/extensions',
     'mozapps/handling',
     'mozapps/preferences',
     'obsolete',
     'pluginproblem',
     'profile',
     'themes',
-    'webapps',
 ]
 
 if CONFIG['MOZ_UPDATER'] and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
     DIRS += ['mozapps/update']
 
 if CONFIG['MOZ_MAINTENANCE_SERVICE'] or CONFIG['MOZ_UPDATER'] and CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
 # Including mozapps/update/common-standalone allows the maintenance service
 # to be built so the maintenance service can be used for things other than
--- a/toolkit/mozapps/installer/windows/nsis/makensis.mk
+++ b/toolkit/mozapps/installer/windows/nsis/makensis.mk
@@ -93,17 +93,8 @@ uninstaller::
 	cp $(CONFIG_DIR)/helper.exe $(DIST)/bin/uninstall
 
 ifdef MOZ_MAINTENANCE_SERVICE
 maintenanceservice_installer::
 	cd $(CONFIG_DIR) && $(MAKENSISU) maintenanceservice_installer.nsi
 	$(NSINSTALL) -D $(DIST)/bin/
 	cp $(CONFIG_DIR)/maintenanceservice_installer.exe $(DIST)/bin
 endif
-
-ifdef MOZ_WEBAPP_RUNTIME
-webapp_uninstaller::
-	$(INSTALL) $(addprefix $(MOZILLA_DIR)/toolkit/mozapps/installer/windows/nsis/,$(TOOLKIT_NSIS_FILES)) $(CONFIG_DIR)
-	$(INSTALL) $(addprefix $(MOZILLA_DIR)/other-licenses/nsis/Plugins/,$(CUSTOM_NSIS_PLUGINS)) $(CONFIG_DIR)
-	cd $(CONFIG_DIR) && $(MAKENSISU) webapp-uninstaller.nsi
-	$(NSINSTALL) -D $(DIST)/bin
-	cp $(CONFIG_DIR)/webapp-uninstaller.exe $(DIST)/bin
-endif
deleted file mode 100644
--- a/toolkit/webapps/LinuxNativeApp.js
+++ /dev/null
@@ -1,341 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Constructor for the Linux native app shell
- *
- * @param aApp {Object} the app object provided to the install function
- * @param aManifest {Object} the manifest data provided by the web app
- * @param aCategories {Array} array of app categories
- * @param aRegistryDir {String} (optional) path to the registry
- */
-function NativeApp(aApp, aManifest, aCategories, aRegistryDir) {
-  CommonNativeApp.call(this, aApp, aManifest, aCategories, aRegistryDir);
-
-  this.iconFile = "icon.png";
-  this.webapprt = "webapprt-stub";
-  this.configJson = "webapp.json";
-  this.webappINI = "webapp.ini";
-  this.zipFile = "application.zip";
-
-  this.backupFiles = [ this.iconFile, this.configJson, this.webappINI ];
-  if (this.isPackaged) {
-    this.backupFiles.push(this.zipFile);
-  }
-
-  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(HOME_DIR, ".local", "share");
-  }
-
-  // The desktop file name is: "owa-" + sanitized app name +
-  // "-" + manifest url hash.
-  this.desktopINI = OS.Path.join(xdg_data_home, "applications",
-                                 "owa-" + this.uniqueName + ".desktop");
-}
-
-NativeApp.prototype = {
-  __proto__: CommonNativeApp.prototype,
-
-  /**
-   * Creates a native installation of the web app in the OS
-   *
-   * @param aManifest {Object} the manifest data provided by the web app
-   * @param aZipPath {String} path to the zip file for packaged apps (undefined
-   *                          for hosted apps)
-   */
-  install: Task.async(function*(aApp, aManifest, aZipPath) {
-    if (this._dryRun) {
-      return;
-    }
-
-    // If the application is already installed, this is a reinstallation.
-    if (WebappOSUtils.getInstallPath(aApp)) {
-      return yield this.prepareUpdate(aApp, aManifest, aZipPath);
-    }
-
-    this._setData(aApp, aManifest);
-
-    // The installation directory name is: sanitized app name +
-    // "-" + manifest url hash.
-    let installDir = OS.Path.join(HOME_DIR, "." + this.uniqueName);
-
-    let dir = getFile(TMP_DIR, this.uniqueName);
-    dir.createUnique(Ci.nsIFile.DIRECTORY_TYPE, PERMS_DIRECTORY);
-    let tmpDir = dir.path;
-
-    // Create the installation in a temporary directory.
-    try {
-      this._copyPrebuiltFiles(tmpDir);
-      yield this._createConfigFiles(tmpDir);
-
-      if (aZipPath) {
-        yield OS.File.move(aZipPath, OS.Path.join(tmpDir, this.zipFile));
-      }
-
-      yield this._getIcon(tmpDir);
-    } catch (ex) {
-      yield OS.File.removeDir(tmpDir, { ignoreAbsent: true });
-      throw ex;
-    }
-
-    // Apply the installation.
-    this._removeInstallation(true, installDir);
-
-    try {
-      yield this._applyTempInstallation(tmpDir, installDir);
-    } catch (ex) {
-      this._removeInstallation(false, installDir);
-      yield OS.File.removeDir(tmpDir, { ignoreAbsent: true });
-      throw ex;
-    }
-  }),
-
-  /**
-   * Creates an update in a temporary directory to be applied later.
-   *
-   * @param aManifest {Object} the manifest data provided by the web app
-   * @param aZipPath {String} path to the zip file for packaged apps (undefined
-   *                          for hosted apps)
-   */
-  prepareUpdate: Task.async(function*(aApp, aManifest, aZipPath) {
-    if (this._dryRun) {
-      return;
-    }
-
-    this._setData(aApp, aManifest);
-
-    let installDir = WebappOSUtils.getInstallPath(aApp);
-    if (!installDir) {
-      throw ERR_NOT_INSTALLED;
-    }
-
-    let baseName = OS.Path.basename(installDir)
-    let oldUniqueName = baseName.substring(1, baseName.length);
-    if (this.uniqueName != oldUniqueName) {
-      // Bug 919799: If the app is still in the registry, migrate its data to
-      // the new format.
-      throw ERR_UPDATES_UNSUPPORTED_OLD_NAMING_SCHEME;
-    }
-
-    let updateDir = OS.Path.join(installDir, "update");
-    yield OS.File.removeDir(updateDir, { ignoreAbsent: true });
-    yield OS.File.makeDir(updateDir);
-
-    try {
-      yield this._createConfigFiles(updateDir);
-
-      if (aZipPath) {
-        yield OS.File.move(aZipPath, OS.Path.join(updateDir, this.zipFile));
-      }
-
-      yield this._getIcon(updateDir);
-    } catch (ex) {
-      yield OS.File.removeDir(updateDir, { ignoreAbsent: true });
-      throw ex;
-    }
-  }),
-
-  /**
-   * Applies an update.
-   */
-  applyUpdate: Task.async(function*(aApp) {
-    if (this._dryRun) {
-      return;
-    }
-
-    let installDir = WebappOSUtils.getInstallPath(aApp);
-    let updateDir = OS.Path.join(installDir, "update");
-
-    let backupDir = yield this._backupInstallation(installDir);
-
-    try {
-      yield this._applyTempInstallation(updateDir, installDir);
-    } catch (ex) {
-      yield this._restoreInstallation(backupDir, installDir);
-      throw ex;
-    } finally {
-      yield OS.File.removeDir(backupDir, { ignoreAbsent: true });
-      yield OS.File.removeDir(updateDir, { ignoreAbsent: true });
-    }
-  }),
-
-  _applyTempInstallation: Task.async(function*(aTmpDir, aInstallDir) {
-    yield moveDirectory(aTmpDir, aInstallDir);
-
-    yield this._createSystemFiles(aInstallDir);
-  }),
-
-  _removeInstallation: function(keepProfile, aInstallDir) {
-    let filesToRemove = [this.desktopINI];
-
-    if (keepProfile) {
-      for (let filePath of this.backupFiles) {
-        filesToRemove.push(OS.Path.join(aInstallDir, filePath));
-      }
-
-      filesToRemove.push(OS.Path.join(aInstallDir, this.webapprt));
-    } else {
-      filesToRemove.push(aInstallDir);
-    }
-
-    removeFiles(filesToRemove);
-  },
-
-  _backupInstallation: Task.async(function*(aInstallDir) {
-    let backupDir = OS.Path.join(aInstallDir, "backup");
-    yield OS.File.removeDir(backupDir, { ignoreAbsent: true });
-    yield OS.File.makeDir(backupDir);
-
-    for (let filePath of this.backupFiles) {
-      yield OS.File.move(OS.Path.join(aInstallDir, filePath),
-                         OS.Path.join(backupDir, filePath));
-    }
-
-    return backupDir;
-  }),
-
-  _restoreInstallation: function(aBackupDir, aInstallDir) {
-    return moveDirectory(aBackupDir, aInstallDir);
-  },
-
-  _copyPrebuiltFiles: function(aDir) {
-    let destDir = getFile(aDir);
-    let stub = getFile(this.runtimeFolder, this.webapprt);
-    stub.copyTo(destDir, null);
-  },
-
-  /**
-   * Translate marketplace categories to freedesktop.org categories.
-   *
-   * @link http://standards.freedesktop.org/menu-spec/menu-spec-latest.html#category-registry
-   *
-   * @return an array of categories
-   */
-  _translateCategories: function() {
-    let translations = {
-      "books": "Education;Literature",
-      "business": "Finance",
-      "education": "Education",
-      "entertainment": "Amusement",
-      "sports": "Sports",
-      "games": "Game",
-      "health-fitness": "MedicalSoftware",
-      "lifestyle": "Amusement",
-      "music": "Audio;Music",
-      "news-weather": "News",
-      "photo-video": "Video;AudioVideo;Photography",
-      "productivity": "Office",
-      "shopping": "Amusement",
-      "social": "Chat",
-      "travel": "Amusement",
-      "reference": "Science;Education;Documentation",
-      "maps-navigation": "Maps",
-      "utilities": "Utility"
-    };
-
-    // The trailing semicolon is needed as written in the freedesktop specification
-    let categories = "";
-    for (let category of this.categories) {
-      let catLower = category.toLowerCase();
-      if (catLower in translations) {
-        categories += translations[catLower] + ";";
-      }
-    }
-
-    return categories;
-  },
-
-  _createConfigFiles: function(aDir) {
-    // ${InstallDir}/webapp.json
-    yield writeToFile(OS.Path.join(aDir, this.configJson),
-                      JSON.stringify(this.webappJson));
-
-    let webappsBundle = Services.strings.createBundle("chrome://global/locale/webapps.properties");
-
-    // ${InstallDir}/webapp.ini
-    let webappINIfile = getFile(aDir, this.webappINI);
-
-    let writer = Cc["@mozilla.org/xpcom/ini-processor-factory;1"].
-                 getService(Ci.nsIINIParserFactory).
-                 createINIParser(webappINIfile).
-                 QueryInterface(Ci.nsIINIParserWriter);
-    writer.setString("Webapp", "Name", this.appLocalizedName);
-    writer.setString("Webapp", "Profile", this.uniqueName);
-    writer.setString("Webapp", "UninstallMsg",
-                     webappsBundle.formatStringFromName("uninstall.notification",
-                                                        [this.appLocalizedName],
-                                                        1));
-    writer.setString("WebappRT", "InstallDir", this.runtimeFolder);
-    writer.writeFile();
-  },
-
-  _createSystemFiles: Task.async(function*(aInstallDir) {
-    let webappsBundle = Services.strings.createBundle("chrome://global/locale/webapps.properties");
-
-    let webapprtPath = OS.Path.join(aInstallDir, this.webapprt);
-
-    // $XDG_DATA_HOME/applications/owa-<webappuniquename>.desktop
-    let desktopINIfile = getFile(this.desktopINI);
-    if (desktopINIfile.parent && !desktopINIfile.parent.exists()) {
-      desktopINIfile.parent.create(Ci.nsIFile.DIRECTORY_TYPE, PERMS_DIRECTORY);
-    }
-
-    let writer = Cc["@mozilla.org/xpcom/ini-processor-factory;1"].
-                 getService(Ci.nsIINIParserFactory).
-                 createINIParser(desktopINIfile).
-                 QueryInterface(Ci.nsIINIParserWriter);
-    writer.setString("Desktop Entry", "Name", this.appLocalizedName);
-    writer.setString("Desktop Entry", "Comment", this.shortDescription);
-    writer.setString("Desktop Entry", "Exec", '"' + webapprtPath + '"');
-    writer.setString("Desktop Entry", "Icon", OS.Path.join(aInstallDir,
-                                                           this.iconFile));
-    writer.setString("Desktop Entry", "Type", "Application");
-    writer.setString("Desktop Entry", "Terminal", "false");
-
-    let categories = this._translateCategories();
-    if (categories)
-      writer.setString("Desktop Entry", "Categories", categories);
-
-    writer.setString("Desktop Entry", "Actions", "Uninstall;");
-    writer.setString("Desktop Action Uninstall", "Name", webappsBundle.GetStringFromName("uninstall.label"));
-    writer.setString("Desktop Action Uninstall", "Exec", webapprtPath + " -remove");
-
-    writer.writeFile();
-
-    yield OS.File.setPermissions(desktopINIfile.path, { unixMode: PERMS_FILE | OS.Constants.libc.S_IXUSR });
-  }),
-
-  /**
-   * Process the icon from the imageStream as retrieved from
-   * the URL by getIconForApp().
-   *
-   * @param aMimeType     ahe icon mimetype
-   * @param aImageStream  the stream for the image data
-   * @param aDir          the directory where the icon should be stored
-   */
-  _processIcon: function(aMimeType, aImageStream, aDir) {
-    let deferred = Promise.defer();
-
-    let imgTools = Cc["@mozilla.org/image/tools;1"].
-                   createInstance(Ci.imgITools);
-
-    let imgContainer = imgTools.decodeImage(aImageStream, aMimeType);
-    let iconStream = imgTools.encodeImage(imgContainer, "image/png");
-
-    let iconFile = getFile(aDir, this.iconFile);
-    let outputStream = FileUtils.openSafeFileOutputStream(iconFile);
-    NetUtil.asyncCopy(iconStream, outputStream, function(aResult) {
-      if (Components.isSuccessCode(aResult)) {
-        deferred.resolve();
-      } else {
-        deferred.reject("Failure copying icon: " + aResult);
-      }
-    });
-
-    return deferred.promise;
-  }
-}
deleted file mode 100644
--- a/toolkit/webapps/MacNativeApp.js
+++ /dev/null
@@ -1,331 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const USER_LIB_DIR = OS.Constants.Path.macUserLibDir;
-const LOCAL_APP_DIR = OS.Constants.Path.macLocalApplicationsDir;
-
-/**
- * Constructor for the Mac native app shell
- *
- * @param aApp {Object} the app object provided to the install function
- * @param aManifest {Object} the manifest data provided by the web app
- * @param aCategories {Array} array of app categories
- * @param aRegistryDir {String} (optional) path to the registry
- */
-function NativeApp(aApp, aManifest, aCategories, aRegistryDir) {
-  CommonNativeApp.call(this, aApp, aManifest, aCategories, aRegistryDir);
-
-  // The ${ProfileDir} is: sanitized app name + "-" + manifest url hash
-  this.appProfileDir = OS.Path.join(USER_LIB_DIR, "Application Support",
-                                    this.uniqueName);
-  this.configJson = "webapp.json";
-
-  this.contentsDir = "Contents";
-  this.macOSDir = OS.Path.join(this.contentsDir, "MacOS");
-  this.resourcesDir = OS.Path.join(this.contentsDir, "Resources");
-  this.iconFile = OS.Path.join(this.resourcesDir, "appicon.icns");
-  this.zipFile = OS.Path.join(this.resourcesDir, "application.zip");
-}
-
-NativeApp.prototype = {
-  __proto__: CommonNativeApp.prototype,
-  /*
-   * The _rootInstallDir property is the path of the directory where we install
-   * apps. In production code, it's "/Applications". In tests, it's
-   * "~/Applications" because on build machines we don't have enough privileges
-   * to write to the global "/Applications" directory.
-   */
-  _rootInstallDir: LOCAL_APP_DIR,
-
-  /**
-   * Creates a native installation of the web app in the OS
-   *
-   * @param aManifest {Object} the manifest data provided by the web app
-   * @param aZipPath {String} path to the zip file for packaged apps (undefined
-   *                          for hosted apps)
-   */
-  install: Task.async(function*(aApp, aManifest, aZipPath) {
-    if (this._dryRun) {
-      return;
-    }
-
-    // If the application is already installed, this is a reinstallation.
-    if (WebappOSUtils.getInstallPath(aApp)) {
-      return yield this.prepareUpdate(aApp, aManifest, aZipPath);
-    }
-
-    this._setData(aApp, aManifest);
-
-    let localAppDir = getFile(this._rootInstallDir);
-    if (!localAppDir.isWritable()) {
-      throw("Not enough privileges to install apps");
-    }
-
-    let destinationName = yield getAvailableFileName([ this._rootInstallDir ],
-                                                     this.appNameAsFilename,
-                                                     ".app");
-
-    let installDir = OS.Path.join(this._rootInstallDir, destinationName);
-
-    let dir = getFile(TMP_DIR, this.appNameAsFilename + ".app");
-    dir.createUnique(Ci.nsIFile.DIRECTORY_TYPE, PERMS_DIRECTORY);
-    let tmpDir = dir.path;
-
-    try {
-      yield this._createDirectoryStructure(tmpDir);
-      this._copyPrebuiltFiles(tmpDir);
-      yield this._createConfigFiles(tmpDir);
-
-      if (aZipPath) {
-        yield OS.File.move(aZipPath, OS.Path.join(tmpDir, this.zipFile));
-      }
-
-      yield this._getIcon(tmpDir);
-    } catch (ex) {
-      yield OS.File.removeDir(tmpDir, { ignoreAbsent: true });
-      throw ex;
-    }
-
-    this._removeInstallation(true, installDir);
-
-    try {
-      // Move the temp installation directory to the /Applications directory
-      yield this._applyTempInstallation(tmpDir, installDir);
-    } catch (ex) {
-      this._removeInstallation(false, installDir);
-      yield OS.File.removeDir(tmpDir, { ignoreAbsent: true });
-      throw ex;
-    }
-  }),
-
-  /**
-   * Creates an update in a temporary directory to be applied later.
-   *
-   * @param aManifest {Object} the manifest data provided by the web app
-   * @param aZipPath {String} path to the zip file for packaged apps (undefined
-   *                          for hosted apps)
-   */
-  prepareUpdate: Task.async(function*(aApp, aManifest, aZipPath) {
-    if (this._dryRun) {
-      return;
-    }
-
-    this._setData(aApp, aManifest);
-
-    let [ oldUniqueName, installDir ] = WebappOSUtils.getLaunchTarget(aApp);
-    if (!installDir) {
-      throw ERR_NOT_INSTALLED;
-    }
-
-    if (this.uniqueName != oldUniqueName) {
-      // Bug 919799: If the app is still in the registry, migrate its data to
-      // the new format.
-      throw ERR_UPDATES_UNSUPPORTED_OLD_NAMING_SCHEME;
-    }
-
-    let updateDir = OS.Path.join(installDir, "update");
-    yield OS.File.removeDir(updateDir, { ignoreAbsent: true });
-    yield OS.File.makeDir(updateDir);
-
-    try {
-      yield this._createDirectoryStructure(updateDir);
-      this._copyPrebuiltFiles(updateDir);
-      yield this._createConfigFiles(updateDir);
-
-      if (aZipPath) {
-        yield OS.File.move(aZipPath, OS.Path.join(updateDir, this.zipFile));
-      }
-
-      yield this._getIcon(updateDir);
-    } catch (ex) {
-      yield OS.File.removeDir(updateDir, { ignoreAbsent: true });
-      throw ex;
-    }
-  }),
-
-  /**
-   * Applies an update.
-   */
-  applyUpdate: Task.async(function*(aApp) {
-    if (this._dryRun) {
-      return;
-    }
-
-    let installDir = WebappOSUtils.getInstallPath(aApp);
-    let updateDir = OS.Path.join(installDir, "update");
-
-    let backupDir = yield this._backupInstallation(installDir);
-
-    try {
-      // Move the update directory to the /Applications directory
-      yield this._applyTempInstallation(updateDir, installDir);
-    } catch (ex) {
-      yield this._restoreInstallation(backupDir, installDir);
-      throw ex;
-    } finally {
-      yield OS.File.removeDir(backupDir, { ignoreAbsent: true });
-      yield OS.File.removeDir(updateDir, { ignoreAbsent: true });
-    }
-  }),
-
-  _applyTempInstallation: Task.async(function*(aTmpDir, aInstallDir) {
-    yield OS.File.move(OS.Path.join(aTmpDir, this.configJson),
-                       OS.Path.join(this.appProfileDir, this.configJson));
-
-    yield moveDirectory(aTmpDir, aInstallDir);
-  }),
-
-  _removeInstallation: function(keepProfile, aInstallDir) {
-    let filesToRemove = [ aInstallDir ];
-
-    if (!keepProfile) {
-      filesToRemove.push(this.appProfileDir);
-    }
-
-    removeFiles(filesToRemove);
-  },
-
-  _backupInstallation: Task.async(function*(aInstallDir) {
-    let backupDir = OS.Path.join(aInstallDir, "backup");
-    yield OS.File.removeDir(backupDir, { ignoreAbsent: true });
-    yield OS.File.makeDir(backupDir);
-
-    yield moveDirectory(OS.Path.join(aInstallDir, this.contentsDir),
-                        backupDir);
-    yield OS.File.move(OS.Path.join(this.appProfileDir, this.configJson),
-                       OS.Path.join(backupDir, this.configJson));
-
-    return backupDir;
-  }),
-
-  _restoreInstallation: Task.async(function*(aBackupDir, aInstallDir) {
-    yield OS.File.move(OS.Path.join(aBackupDir, this.configJson),
-                       OS.Path.join(this.appProfileDir, this.configJson));
-    yield moveDirectory(aBackupDir,
-                        OS.Path.join(aInstallDir, this.contentsDir));
-  }),
-
-  _createDirectoryStructure: Task.async(function*(aDir) {
-    yield OS.File.makeDir(this.appProfileDir,
-                          { unixMode: PERMS_DIRECTORY, ignoreExisting: true });
-
-    yield OS.File.makeDir(OS.Path.join(aDir, this.contentsDir),
-                          { unixMode: PERMS_DIRECTORY, ignoreExisting: true });
-
-    yield OS.File.makeDir(OS.Path.join(aDir, this.macOSDir),
-                          { unixMode: PERMS_DIRECTORY, ignoreExisting: true });
-
-    yield OS.File.makeDir(OS.Path.join(aDir, this.resourcesDir),
-                          { unixMode: PERMS_DIRECTORY, ignoreExisting: true });
-  }),
-
-  _copyPrebuiltFiles: function(aDir) {
-    let destDir = getFile(aDir, this.macOSDir);
-    let stub = getFile(OS.Path.join(OS.Path.dirname(this.runtimeFolder),
-                                    "Resources"), "webapprt-stub");
-    stub.copyTo(destDir, "webapprt");
-  },
-
-  _createConfigFiles: function(aDir) {
-    // ${ProfileDir}/webapp.json
-    yield writeToFile(OS.Path.join(aDir, this.configJson),
-                      JSON.stringify(this.webappJson));
-
-    // ${InstallDir}/Contents/MacOS/webapp.ini
-    let applicationINI = getFile(aDir, this.macOSDir, "webapp.ini");
-
-    let writer = Cc["@mozilla.org/xpcom/ini-processor-factory;1"].
-                 getService(Ci.nsIINIParserFactory).
-                 createINIParser(applicationINI).
-                 QueryInterface(Ci.nsIINIParserWriter);
-    writer.setString("Webapp", "Name", this.appLocalizedName);
-    writer.setString("Webapp", "Profile", this.uniqueName);
-    writer.writeFile();
-    yield OS.File.setPermissions(applicationINI.path, { unixMode: PERMS_FILE });
-
-    // ${InstallDir}/Contents/Info.plist
-    let infoPListContent = '<?xml version="1.0" encoding="UTF-8"?>\n\
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n\
-<plist version="1.0">\n\
-  <dict>\n\
-    <key>CFBundleDevelopmentRegion</key>\n\
-    <string>English</string>\n\
-    <key>CFBundleDisplayName</key>\n\
-    <string>' + escapeXML(this.appLocalizedName) + '</string>\n\
-    <key>CFBundleExecutable</key>\n\
-    <string>webapprt</string>\n\
-    <key>CFBundleIconFile</key>\n\
-    <string>appicon</string>\n\
-    <key>CFBundleIdentifier</key>\n\
-    <string>' + escapeXML(this.uniqueName) + '</string>\n\
-    <key>CFBundleInfoDictionaryVersion</key>\n\
-    <string>6.0</string>\n\
-    <key>CFBundleName</key>\n\
-    <string>' + escapeXML(this.appLocalizedName) + '</string>\n\
-    <key>CFBundlePackageType</key>\n\
-    <string>APPL</string>\n\
-    <key>CFBundleVersion</key>\n\
-    <string>0</string>\n\
-    <key>NSHighResolutionCapable</key>\n\
-    <true/>\n\
-    <key>NSSupportsAutomaticGraphicsSwitching</key>\n\
-    <true/>\n\
-    <key>NSPrincipalClass</key>\n\
-    <string>GeckoNSApplication</string>\n\
-    <key>FirefoxBinary</key>\n\
-#expand     <string>__MOZ_MACBUNDLE_ID__</string>\n\
-  </dict>\n\
-</plist>';
-
-    yield writeToFile(OS.Path.join(aDir, this.contentsDir, "Info.plist"),
-                      infoPListContent);
-  },
-
-  /**
-   * Process the icon from the imageStream as retrieved from
-   * the URL by getIconForApp(). This will bundle the icon to the
-   * app package at Contents/Resources/appicon.icns.
-   *
-   * @param aMimeType     the icon mimetype
-   * @param aImageStream  the stream for the image data
-   * @param aDir          the directory where the icon should be stored
-   */
-  _processIcon: function(aMimeType, aIcon, aDir) {
-    let deferred = Promise.defer();
-
-    let finalIconPath = OS.Path.join(aDir, this.iconFile);
-    let tmpIconPath = OS.Path.join(OS.Constants.Path.tmpDir, "appicon.icns");
-
-    function conversionDone(aSubject, aTopic) {
-      if (aTopic != "process-finished") {
-        deferred.reject("Failure converting icon, exit code: " + aSubject.exitValue);
-        return;
-      }
-
-      // SIPS silently fails to convert the icon, so we need to verify if the
-      // icon was successfully converted.
-      OS.File.exists(tmpIconPath).then((aExists) => {
-        if (aExists) {
-          OS.File.move(tmpIconPath, finalIconPath).then(
-            deferred.resolve, err => deferred.reject(err));
-        } else {
-          deferred.reject("Failure converting icon, unrecognized image format");
-        }
-      });
-    }
-
-    let process = Cc["@mozilla.org/process/util;1"].
-                  createInstance(Ci.nsIProcess);
-    let sipsFile = getFile("/usr/bin/sips");
-
-    process.init(sipsFile);
-    process.runAsync(["-s", "format", "icns",
-                      aIcon.path,
-                      "--out", tmpIconPath,
-                      "-z", "128", "128"],
-                      9, conversionDone);
-
-    return deferred.promise;
-  }
-}
deleted file mode 100644
--- a/toolkit/webapps/NativeApp.jsm
+++ /dev/null
@@ -1,478 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-this.EXPORTED_SYMBOLS = ["NativeApp"];
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-const Cu = Components.utils;
-const Cr = Components.results;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/FileUtils.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
-Cu.import("resource://gre/modules/WebappOSUtils.jsm");
-Cu.import("resource://gre/modules/AppsUtils.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
-
-const DEFAULT_ICON_URL = "chrome://global/skin/icons/webapps-64.png";
-
-const ERR_NOT_INSTALLED = "The application isn't installed";
-const ERR_UPDATES_UNSUPPORTED_OLD_NAMING_SCHEME =
-  "Updates for apps installed with the old naming scheme unsupported";
-
-// 0755
-const PERMS_DIRECTORY = OS.Constants.libc.S_IRWXU |
-                        OS.Constants.libc.S_IRGRP | OS.Constants.libc.S_IXGRP |
-                        OS.Constants.libc.S_IROTH | OS.Constants.libc.S_IXOTH;
-
-// 0644
-const PERMS_FILE = OS.Constants.libc.S_IRUSR | OS.Constants.libc.S_IWUSR |
-                   OS.Constants.libc.S_IRGRP |
-                   OS.Constants.libc.S_IROTH;
-
-const DESKTOP_DIR = OS.Constants.Path.desktopDir;
-const HOME_DIR = OS.Constants.Path.homeDir;
-const TMP_DIR = OS.Constants.Path.tmpDir;
-
-/**
- * This function implements the common constructor for
- * the Windows, Mac and Linux native app shells. It sets
- * the app unique name. It's meant to be called as
- * CommonNativeApp.call(this, ...) from the platform-specific
- * constructor.
- *
- * @param aApp {Object} the app object provided to the install function
- * @param aManifest {Object} the manifest data provided by the web app
- * @param aCategories {Array} array of app categories
- * @param aRegistryDir {String} (optional) path to the registry
- *
- */
-function CommonNativeApp(aApp, aManifest, aCategories, aRegistryDir) {
-  // Set the name property of the app object, otherwise
-  // WebappOSUtils::getUniqueName won't work.
-  aApp.name = aManifest.name;
-  this.uniqueName = WebappOSUtils.getUniqueName(aApp);
-
-  let localeManifest =
-    new ManifestHelper(aManifest, aApp.origin, aApp.manifestURL);
-
-  this.appLocalizedName = localeManifest.name;
-  this.appNameAsFilename = stripStringForFilename(aApp.name);
-
-  if (aApp.updateManifest) {
-    this.isPackaged = true;
-  }
-
-  this.categories = aCategories.slice(0);
-
-  this.registryDir = aRegistryDir || OS.Constants.Path.profileDir;
-
-  this._dryRun = false;
-  try {
-    if (Services.prefs.getBoolPref("browser.mozApps.installer.dry_run")) {
-      this._dryRun = true;
-    }
-  } catch (ex) {}
-}
-
-CommonNativeApp.prototype = {
-  uniqueName: null,
-  appLocalizedName: null,
-  appNameAsFilename: null,
-  iconURI: null,
-  developerName: null,
-  shortDescription: null,
-  categories: null,
-  webappJson: null,
-  runtimeFolder: null,
-  manifest: null,
-  registryDir: null,
-
-  /**
-   * This function reads and parses the data from the app
-   * manifest and stores it in the NativeApp object.
-   *
-   * @param aManifest {Object} the manifest data provided by the web app
-   *
-   */
-  _setData: function(aApp, aManifest) {
-    let manifest = new ManifestHelper(aManifest, aApp.origin, aApp.manifestURL);
-    let origin = Services.io.newURI(aApp.origin, null, null);
-
-#ifdef XP_WIN
-    let biggestIconURL = manifest.biggestIconURL(v => v <= 256);
-#else
-    let biggestIconURL = manifest.biggestIconURL();
-#endif
-
-    this.iconURI = Services.io.newURI(biggestIconURL || DEFAULT_ICON_URL, null,
-                                      null);
-
-    if (manifest.developer) {
-      if (manifest.developer.name) {
-        let devName = manifest.developer.name.substr(0, 128);
-        if (devName) {
-          this.developerName = devName;
-        }
-      }
-
-      if (manifest.developer.url) {
-        this.developerUrl = manifest.developer.url;
-      }
-    }
-
-    if (manifest.description) {
-      let firstLine = manifest.description.split("\n")[0];
-      let shortDesc = firstLine.length <= 256
-                      ? firstLine
-                      : firstLine.substr(0, 253) + "…";
-      this.shortDescription = shortDesc;
-    } else {
-      this.shortDescription = this.appLocalizedName;
-    }
-
-    if (manifest.version) {
-      this.version = manifest.version;
-    }
-
-    this.webappJson = {
-      // The app registry is the Firefox profile from which the app
-      // was installed.
-      "registryDir": this.registryDir,
-      "app": {
-        "manifest": aManifest,
-        "origin": aApp.origin,
-        "manifestURL": aApp.manifestURL,
-        "installOrigin": aApp.installOrigin,
-        "categories": this.categories,
-        "receipts": aApp.receipts,
-        "installTime": aApp.installTime,
-      }
-    };
-
-    if (aApp.etag) {
-      this.webappJson.app.etag = aApp.etag;
-    }
-
-    if (aApp.packageEtag) {
-      this.webappJson.app.packageEtag = aApp.packageEtag;
-    }
-
-    if (aApp.updateManifest) {
-      this.webappJson.app.updateManifest = aApp.updateManifest;
-    }
-
-    this.runtimeFolder = OS.Constants.Path.libDir;
-  },
-
-  /**
-   * This function retrieves the icon for an app.
-   * If the retrieving fails, it uses the default chrome icon.
-   */
-  _getIcon: function(aTmpDir) {
-    try {
-      // If the icon is in the zip package, we should modify the url
-      // to point to the zip file (we can't use the app protocol yet
-      // because the app isn't installed yet).
-      if (this.iconURI.scheme == "app") {
-        let zipUrl = OS.Path.toFileURI(OS.Path.join(aTmpDir,
-                                                    this.zipFile));
-
-        let filePath = this.iconURI.QueryInterface(Ci.nsIURL).filePath;
-
-        this.iconURI = Services.io.newURI("jar:" + zipUrl + "!" + filePath,
-                                          null, null);
-      }
-
-
-      let [ mimeType, icon ] = yield downloadIcon(this.iconURI);
-      yield this._processIcon(mimeType, icon, aTmpDir);
-    }
-    catch(e) {
-      Cu.reportError("Failure retrieving icon: " + e);
-
-      let iconURI = Services.io.newURI(DEFAULT_ICON_URL, null, null);
-
-      let [ mimeType, icon ] = yield downloadIcon(iconURI);
-      yield this._processIcon(mimeType, icon, aTmpDir);
-
-      // Set the iconURI property so that the user notification will have the
-      // correct icon.
-      this.iconURI = iconURI;
-    }
-  },
-
-  /**
-   * Creates the profile to be used for this app.
-   */
-  createProfile: function() {
-    if (this._dryRun) {
-      return null;
-    }
-
-    let profSvc = Cc["@mozilla.org/toolkit/profile-service;1"].
-                  getService(Ci.nsIToolkitProfileService);
-
-    try {
-      let appProfile = profSvc.createDefaultProfileForApp(this.uniqueName,
-                                                          null, null);
-      return appProfile.localDir;
-    } catch (ex if ex.result == Cr.NS_ERROR_ALREADY_INITIALIZED) {
-      return null;
-    }
-  },
-};
-
-#ifdef XP_WIN
-
-#include WinNativeApp.js
-
-#elifdef XP_MACOSX
-
-#include MacNativeApp.js
-
-#elifdef XP_UNIX
-
-#include LinuxNativeApp.js
-
-#endif
-
-/* Helper Functions */
-
-/**
- * Async write a data string into a file
- *
- * @param aPath     the path to the file to write to
- * @param aData     a string with the data to be written
- */
-function writeToFile(aPath, aData) {
-  return Task.spawn(function() {
-    let data = new TextEncoder().encode(aData);
-
-    let file;
-    try {
-      file = yield OS.File.open(aPath, { truncate: true, write: true },
-                                { unixMode: PERMS_FILE });
-      yield file.write(data);
-    } finally {
-      yield file.close();
-    }
-  });
-}
-
-/**
- * Strips all non-word characters from the beginning and end of a string.
- * Strips invalid characters from the string.
- *
- */
-function stripStringForFilename(aPossiblyBadFilenameString) {
-  // Strip everything from the front up to the first [0-9a-zA-Z]
-  let stripFrontRE = new RegExp("^\\W*", "gi");
-
-  // Strip white space characters starting from the last [0-9a-zA-Z]
-  let stripBackRE = new RegExp("\\s*$", "gi");
-
-  // Strip invalid characters from the filename
-  let filenameRE = new RegExp("[<>:\"/\\\\|\\?\\*]", "gi");
-
-  let stripped = aPossiblyBadFilenameString.replace(stripFrontRE, "");
-  stripped = stripped.replace(stripBackRE, "");
-  stripped = stripped.replace(filenameRE, "");
-
-  // If the filename ends up empty, let's call it "webapp".
-  if (stripped == "") {
-    stripped = "webapp";
-  }
-
-  return stripped;
-}
-
-/**
- * Finds a unique name available in a folder (i.e., non-existent file)
- *
- * @param aPathSet a set of paths that represents the set of
- * directories where we want to write
- * @param aName   string with the filename (minus the extension) desired
- * @param aExtension string with the file extension, including the dot
-
- * @return file name or null if folder is unwritable or unique name
- *         was not available
- */
-function getAvailableFileName(aPathSet, aName, aExtension) {
-  return Task.spawn(function*() {
-    let name = aName + aExtension;
-
-    function checkUnique(aName) {
-      return Task.spawn(function*() {
-        for (let path of aPathSet) {
-          if (yield OS.File.exists(OS.Path.join(path, aName))) {
-            return false;
-          }
-        }
-
-        return true;
-      });
-    }
-
-    if (yield checkUnique(name)) {
-      return name;
-    }
-
-    // If we're here, the plain name wasn't enough. Let's try modifying the name
-    // by adding "(" + num + ")".
-    for (let i = 2; i < 100; i++) {
-      name = aName + " (" + i + ")" + aExtension;
-
-      if (yield checkUnique(name)) {
-        return name;
-      }
-    }
-
-    throw "No available filename";
-  });
-}
-
-/**
- * Attempts to remove files or directories.
- *
- * @param aPaths An array with paths to files to remove
- */
-function removeFiles(aPaths) {
-  for (let path of aPaths) {
-    let file = getFile(path);
-
-    try {
-      if (file.exists()) {
-        file.followLinks = false;
-        file.remove(true);
-      }
-    } catch(ex) {}
-  }
-}
-
-/**
- * Move (overwriting) the contents of one directory into another.
- *
- * @param srcPath A path to the source directory
- * @param destPath A path to the destination directory
- */
-function moveDirectory(srcPath, destPath) {
-  let srcDir = getFile(srcPath);
-  let destDir = getFile(destPath);
-
-  let entries = srcDir.directoryEntries;
-  let array = [];
-  while (entries.hasMoreElements()) {
-    let entry = entries.getNext().QueryInterface(Ci.nsIFile);
-    if (entry.isDirectory()) {
-      yield moveDirectory(entry.path, OS.Path.join(destPath, entry.leafName));
-    } else {
-      entry.moveTo(destDir, entry.leafName);
-    }
-  }
-
-  // The source directory is now empty, remove it.
-  yield OS.File.removeEmptyDir(srcPath);
-}
-
-function escapeXML(aStr) {
-  return aStr.toString()
-             .replace(/&/g, "&amp;")
-             .replace(/"/g, "&quot;")
-             .replace(/'/g, "&apos;")
-             .replace(/</g, "&lt;")
-             .replace(/>/g, "&gt;");
-}
-
-// 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;
-}
-
-// Download an icon using either a temp file or a pipe.
-function downloadIcon(aIconURI) {
-  let deferred = Promise.defer();
-
-  let mimeService = Cc["@mozilla.org/mime;1"].getService(Ci.nsIMIMEService);
-  let mimeType;
-  try {
-    let tIndex = aIconURI.path.indexOf(";");
-    if("data" == aIconURI.scheme && tIndex != -1) {
-      mimeType = aIconURI.path.substring(0, tIndex);
-    } else {
-      mimeType = mimeService.getTypeFromURI(aIconURI);
-     }
-  } catch(e) {
-    deferred.reject("Failed to determine icon MIME type: " + e);
-    return deferred.promise;
-  }
-
-  function onIconDownloaded(aStatusCode, aIcon) {
-    if (Components.isSuccessCode(aStatusCode)) {
-      deferred.resolve([ mimeType, aIcon ]);
-    } else {
-      deferred.reject("Failure downloading icon: " + aStatusCode);
-    }
-  }
-
-  try {
-#ifdef XP_MACOSX
-    let downloadObserver = {
-      onDownloadComplete: function(downloader, request, cx, aStatus, file) {
-        onIconDownloaded(aStatus, file);
-      }
-    };
-
-    let tmpIcon = Services.dirsvc.get("TmpD", Ci.nsIFile);
-    tmpIcon.append("tmpicon." + mimeService.getPrimaryExtension(mimeType, ""));
-    tmpIcon.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, parseInt("666", 8));
-
-    let listener = Cc["@mozilla.org/network/downloader;1"]
-                     .createInstance(Ci.nsIDownloader);
-    listener.init(downloadObserver, tmpIcon);
-#else
-    let pipe = Cc["@mozilla.org/pipe;1"]
-                 .createInstance(Ci.nsIPipe);
-    pipe.init(true, true, 0, 0xffffffff, null);
-
-    let listener = Cc["@mozilla.org/network/simple-stream-listener;1"]
-                     .createInstance(Ci.nsISimpleStreamListener);
-    listener.init(pipe.outputStream, {
-        onStartRequest: function() {},
-        onStopRequest: function(aRequest, aContext, aStatusCode) {
-          pipe.outputStream.close();
-          onIconDownloaded(aStatusCode, pipe.inputStream);
-       }
-    });
-#endif
-
-    // If not fetching an icon from chrome:// then we should create a
-    // NoAppCodeBasePrincipal. Note, that we are still in the process of
-    // installing the app, hence app.origin is not available yet and
-    // therefore we can not call getAppCodebasePrincipal.
-    let principal =
-      aIconURI.schemeIs("chrome") ?
-        Services.scriptSecurityManager.getSystemPrincipal() :
-        Services.scriptSecurityManager.createCodebasePrincipal(aIconURI, {});
-
-    let channel = NetUtil.newChannel({
-      uri: aIconURI,
-      loadingPrincipal: principal,
-      contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE});
-    let { BadCertHandler } = Cu.import("resource://gre/modules/CertUtils.jsm", {});
-    // Pass true to avoid optional redirect-cert-checking behavior.
-    channel.notificationCallbacks = new BadCertHandler(true);
-
-    channel.asyncOpen(listener, null);
-  } catch(e) {
-    deferred.reject("Failure initiating download of icon: " + e);
-  }
-
-  return deferred.promise;
-}
deleted file mode 100644
--- a/toolkit/webapps/WebappOSUtils.jsm
+++ /dev/null
@@ -1,474 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu, Constructor: CC } = Components;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/FileUtils.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
-
-#ifndef MOZ_B2G
-#ifdef XP_MACOSX
-Cu.import("resource://gre/modules/osfile.jsm");
-#endif
-#endif
-
-this.EXPORTED_SYMBOLS = ["WebappOSUtils"];
-
-// Returns the MD5 hash of a string.
-function computeHash(aString) {
-  let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].
-                  createInstance(Ci.nsIScriptableUnicodeConverter);
-  converter.charset = "UTF-8";
-  let result = {};
-  // Data is an array of bytes.
-  let data = converter.convertToByteArray(aString, result);
-
-  let hasher = Cc["@mozilla.org/security/hash;1"].
-               createInstance(Ci.nsICryptoHash);
-  hasher.init(hasher.MD5);
-  hasher.update(data, data.length);
-  // We're passing false to get the binary hash and not base64.
-  let hash = hasher.finish(false);
-
-  function toHexString(charCode) {
-    return ("0" + charCode.toString(16)).slice(-2);
-  }
-
-  // Convert the binary hash data to a hex string.
-  return Array.from(hash, (c, i) => toHexString(hash.charCodeAt(i))).join("");
-}
-
-this.WebappOSUtils = {
-  getUniqueName: function(aApp) {
-    return this.sanitizeStringForFilename(aApp.name).toLowerCase() + "-" +
-           computeHash(aApp.manifestURL);
-  },
-
-#ifdef XP_WIN
-  /**
-   * Returns the registry key associated to the given app and a boolean that
-   * specifies whether we're using the old naming scheme or the new one.
-   */
-  getAppRegKey: function(aApp) {
-    let regKey = Cc["@mozilla.org/windows-registry-key;1"].
-                 createInstance(Ci.nsIWindowsRegKey);
-
-    try {
-      regKey.open(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
-                  "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" +
-                  this.getUniqueName(aApp), Ci.nsIWindowsRegKey.ACCESS_READ);
-
-      return { value: regKey,
-               namingSchemeVersion: 2};
-    } catch (ex) {}
-
-    // Fall back to the old installation naming scheme
-    try {
-      regKey.open(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
-                  "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" +
-                  aApp.origin, Ci.nsIWindowsRegKey.ACCESS_READ);
-
-      return { value: regKey,
-               namingSchemeVersion: 1 };
-    } catch (ex) {}
-
-    return null;
-  },
-#endif
-
-  /**
-   * Returns the executable of the given app, identifying it by its unique name,
-   * which is in either the new format or the old format.
-   * On Mac OS X, it returns the identifier of the app.
-   *
-   * The new format ensures a readable and unique name for an app by combining
-   * its name with a hash of its manifest URL.  The old format uses its origin,
-   * which is only unique until we support multiple apps per origin.
-   */
-  getLaunchTarget: function(aApp) {
-#ifdef XP_WIN
-    let appRegKey = this.getAppRegKey(aApp);
-
-    if (!appRegKey) {
-      return null;
-    }
-
-    let appFilename, installLocation;
-    try {
-      appFilename = appRegKey.value.readStringValue("AppFilename");
-      installLocation = appRegKey.value.readStringValue("InstallLocation");
-    } catch (ex) {
-      return null;
-    } finally {
-      appRegKey.value.close();
-    }
-
-    installLocation = installLocation.substring(1, installLocation.length - 1);
-
-    if (appRegKey.namingSchemeVersion == 1 &&
-        !this.isOldInstallPathValid(aApp, installLocation)) {
-      return null;
-    }
-
-    let initWithPath = CC("@mozilla.org/file/local;1",
-                          "nsILocalFile", "initWithPath");
-    let launchTarget = initWithPath(installLocation);
-    launchTarget.append(appFilename + ".exe");
-
-    return launchTarget;
-#elifdef XP_MACOSX
-    let uniqueName = this.getUniqueName(aApp);
-
-    let mwaUtils = Cc["@mozilla.org/widget/mac-web-app-utils;1"].
-                   createInstance(Ci.nsIMacWebAppUtils);
-
-    try {
-      let path;
-      if (path = mwaUtils.pathForAppWithIdentifier(uniqueName)) {
-        return [ uniqueName, path ];
-      }
-    } catch(ex) {}
-
-    // Fall back to the old installation naming scheme
-    try {
-      let path;
-      if ((path = mwaUtils.pathForAppWithIdentifier(aApp.origin)) &&
-           this.isOldInstallPathValid(aApp, path)) {
-        return [ aApp.origin, path ];
-      }
-    } catch(ex) {}
-
-    return [ null, null ];
-#elifdef XP_UNIX
-    let uniqueName = this.getUniqueName(aApp);
-
-    let exeFile = Services.dirsvc.get("Home", Ci.nsIFile);
-    exeFile.append("." + uniqueName);
-    exeFile.append("webapprt-stub");
-
-    // Fall back to the old installation naming scheme
-    if (!exeFile.exists()) {
-      exeFile = Services.dirsvc.get("Home", Ci.nsIFile);
-
-      let origin = Services.io.newURI(aApp.origin, null, null);
-      let installDir = "." + origin.scheme + ";" +
-                       origin.host +
-                       (origin.port != -1 ? ";" + origin.port : "");
-
-      exeFile.append(installDir);
-      exeFile.append("webapprt-stub");
-
-      if (!exeFile.exists() ||
-          !this.isOldInstallPathValid(aApp, exeFile.parent.path)) {
-        return null;
-      }
-    }
-
-    return exeFile;
-#endif
-  },
-
-  getInstallPath: function(aApp) {
-#if defined(MOZ_B2G) || defined(MOZ_B2GDROID) || defined(MOZ_FENNEC)
-    // All b2g & fennec builds.
-    return aApp.basePath + "/" + aApp.id;
-
-#elifdef MOZ_PHOENIX
-   // Firefox
-
-#ifdef XP_WIN
-    let execFile = this.getLaunchTarget(aApp);
-    if (!execFile) {
-      return null;
-    }
-
-    return execFile.parent.path;
-#elifdef XP_MACOSX
-    let [ bundleID, path ] = this.getLaunchTarget(aApp);
-    return path;
-#elifdef XP_UNIX
-    let execFile = this.getLaunchTarget(aApp);
-    if (!execFile) {
-      return null;
-    }
-
-    return execFile.parent.path;
-#endif
-
-#elifdef MOZ_WEBAPP_RUNTIME
-    // Webapp runtime
-
-#ifdef XP_WIN
-    let execFile = this.getLaunchTarget(aApp);
-    if (!execFile) {
-      return null;
-    }
-
-    return execFile.parent.path;
-#elifdef XP_MACOSX
-    let [ bundleID, path ] = this.getLaunchTarget(aApp);
-    return path;
-#elifdef XP_UNIX
-    let execFile = this.getLaunchTarget(aApp);
-    if (!execFile) {
-      return null;
-    }
-
-    return execFile.parent.path;
-#endif
-
-#endif
-    // Anything unsupported
-    throw new Error("Unsupported apps platform");
-  },
-
-  getPackagePath: function(aApp) {
-    let packagePath = this.getInstallPath(aApp);
-
-    // Only for Firefox on Mac OS X
-#ifndef MOZ_B2G
-#ifdef XP_MACOSX
-    packagePath = OS.Path.join(packagePath, "Contents", "Resources");
-#endif
-#endif
-
-    return packagePath;
-  },
-
-  launch: function(aApp) {
-    let uniqueName = this.getUniqueName(aApp);
-
-#ifdef XP_WIN
-    let launchTarget = this.getLaunchTarget(aApp);
-    if (!launchTarget) {
-      return false;
-    }
-
-    try {
-      let process = Cc["@mozilla.org/process/util;1"].
-                    createInstance(Ci.nsIProcess);
-
-      process.init(launchTarget);
-      process.runwAsync([], 0);
-    } catch (e) {
-      return false;
-    }
-
-    return true;
-#elifdef XP_MACOSX
-    let [ launchIdentifier, path ] = this.getLaunchTarget(aApp);
-    if (!launchIdentifier) {
-      return false;
-    }
-
-    let mwaUtils = Cc["@mozilla.org/widget/mac-web-app-utils;1"].
-                   createInstance(Ci.nsIMacWebAppUtils);
-
-    try {
-      mwaUtils.launchAppWithIdentifier(launchIdentifier);
-    } catch(e) {
-      return false;
-    }
-
-    return true;
-#elifdef XP_UNIX
-    let exeFile = this.getLaunchTarget(aApp);
-    if (!exeFile) {
-      return false;
-    }
-
-    try {
-      let process = Cc["@mozilla.org/process/util;1"]
-                      .createInstance(Ci.nsIProcess);
-
-      process.init(exeFile);
-      process.runAsync([], 0);
-    } catch (e) {
-      return false;
-    }
-
-    return true;
-#endif
-  },
-
-  uninstall: function(aApp) {
-#ifdef XP_WIN
-    let appRegKey = this.getAppRegKey(aApp);
-
-    if (!appRegKey) {
-      return Promise.reject("App registry key not found");
-    }
-
-    let deferred = Promise.defer();
-
-    try {
-      let uninstallerPath = appRegKey.value.readStringValue("UninstallString");
-      uninstallerPath = uninstallerPath.substring(1, uninstallerPath.length - 1);
-
-      let uninstaller = Cc["@mozilla.org/file/local;1"].
-                        createInstance(Ci.nsIFile);
-      uninstaller.initWithPath(uninstallerPath);
-
-      let process = Cc["@mozilla.org/process/util;1"].
-                    createInstance(Ci.nsIProcess);
-      process.init(uninstaller);
-      process.runwAsync(["/S"], 1, (aSubject, aTopic) => {
-        if (aTopic == "process-finished") {
-          deferred.resolve(true);
-        } else {
-          deferred.reject("Uninstaller failed with exit code: " + aSubject.exitValue);
-        }
-      });
-    } catch (e) {
-      deferred.reject(e);
-    } finally {
-      appRegKey.value.close();
-    }
-
-    return deferred.promise;
-#elifdef XP_MACOSX
-    let [ , path ] = this.getLaunchTarget(aApp);
-    if (!path) {
-      return Promise.reject("App not found");
-    }
-
-    let deferred = Promise.defer();
-
-    let mwaUtils = Cc["@mozilla.org/widget/mac-web-app-utils;1"].
-                   createInstance(Ci.nsIMacWebAppUtils);
-
-    mwaUtils.trashApp(path, (aResult) => {
-      if (aResult == Cr.NS_OK) {
-        deferred.resolve(true);
-      } else {
-        deferred.reject("Error moving the app to the Trash: " + aResult);
-      }
-    });
-
-    return deferred.promise;
-#elifdef XP_UNIX
-    let exeFile = this.getLaunchTarget(aApp);
-    if (!exeFile) {
-      return Promise.reject("App executable file not found");
-    }
-
-    let deferred = Promise.defer();
-
-    try {
-      let process = Cc["@mozilla.org/process/util;1"]
-                      .createInstance(Ci.nsIProcess);
-
-      process.init(exeFile);
-      process.runAsync(["-remove"], 1, (aSubject, aTopic) => {
-        if (aTopic == "process-finished") {
-          deferred.resolve(true);
-        } else {
-          deferred.reject("Uninstaller failed with exit code: " + aSubject.exitValue);
-        }
-      });
-    } catch (e) {
-      deferred.reject(e);
-    }
-
-    return deferred.promise;
-#endif
-  },
-
-  /**
-   * Returns true if the given install path (in the old naming scheme) actually
-   * belongs to the given application.
-   */
-  isOldInstallPathValid: function(aApp, aInstallPath) {
-    // Applications with an origin that starts with "app" are packaged apps and
-    // packaged apps have never been installed using the old naming scheme.
-    // After bug 910465, we'll have a better way to check if an app is
-    // packaged.
-    if (aApp.origin.startsWith("app")) {
-      return false;
-    }
-
-    // Bug 915480: We could check the app name from the manifest to
-    // better verify the installation path.
-    return true;
-  },
-
-  /**
-   * Checks if the given app is locally installed.
-   */
-  isLaunchable: function(aApp) {
-#ifdef MOZ_WIDGET_ANDROID
-    return true;
-#else
-
-    let uniqueName = this.getUniqueName(aApp);
-
-#ifdef XP_WIN
-    if (!this.getLaunchTarget(aApp)) {
-      return false;
-    }
-
-    return true;
-#elifdef XP_MACOSX
-    if (!this.getInstallPath(aApp)) {
-      return false;
-    }
-
-    return true;
-#elifdef XP_UNIX
-    let env = Cc["@mozilla.org/process/environment;1"]
-                .getService(Ci.nsIEnvironment);
-
-    let xdg_data_home_env;
-    try {
-      xdg_data_home_env = env.get("XDG_DATA_HOME");
-    } catch(ex) {}
-
-    let desktopINI;
-    if (xdg_data_home_env) {
-      desktopINI = new FileUtils.File(xdg_data_home_env);
-    } else {
-      desktopINI = FileUtils.getFile("Home", [".local", "share"]);
-    }
-    desktopINI.append("applications");
-    desktopINI.append("owa-" + uniqueName + ".desktop");
-
-    // Fall back to the old installation naming scheme
-    if (!desktopINI.exists()) {
-      if (xdg_data_home_env) {
-        desktopINI = new FileUtils.File(xdg_data_home_env);
-      } else {
-        desktopINI = FileUtils.getFile("Home", [".local", "share"]);
-      }
-
-      let origin = Services.io.newURI(aApp.origin, null, null);
-      let oldUniqueName = origin.scheme + ";" +
-                          origin.host +
-                          (origin.port != -1 ? ";" + origin.port : "");
-
-      desktopINI.append("owa-" + oldUniqueName + ".desktop");
-
-      if (!desktopINI.exists()) {
-        return false;
-      }
-
-      let installDir = Services.dirsvc.get("Home", Ci.nsIFile);
-      installDir.append("." + origin.scheme + ";" + origin.host +
-                        (origin.port != -1 ? ";" + origin.port : ""));
-
-      return isOldInstallPathValid(aApp, installDir.path);
-    }
-
-    return true;
-#endif
-#endif
-  },
-
-  /**
-   * Sanitize the filename (accepts only a-z, 0-9, - and _)
-   */
-  sanitizeStringForFilename: function(aPossiblyBadFilenameString) {
-    return aPossiblyBadFilenameString.replace(/[^a-z0-9_\-]/gi, "");
-  }
-}
deleted file mode 100644
--- a/toolkit/webapps/WinNativeApp.js
+++ /dev/null
@@ -1,469 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const PROGS_DIR = OS.Constants.Path.winStartMenuProgsDir;
-const APP_DATA_DIR = OS.Constants.Path.winAppDataDir;
-
-/*************************************
- * Windows app installer
- *
- * The Windows installation process will generate the following files:
- *
- * ${FolderName} = sanitized app name + "-" + manifest url hash
- *
- * %APPDATA%/${FolderName}
- *   - webapp.ini
- *   - webapp.json
- *   - ${AppName}.exe
- *   - ${AppName}.lnk
- *   / uninstall
- *     - webapp-uninstaller.exe
- *     - shortcuts_log.ini
- *     - uninstall.log
- *   / chrome/icons/default/
- *     - default.ico
- *
- * After the app runs for the first time, a profiles/ folder will also be
- * created which will host the user profile for this app.
- */
-
-/**
- * Constructor for the Windows native app shell
- *
- * @param aApp {Object} the app object provided to the install function
- * @param aManifest {Object} the manifest data provided by the web app
- * @param aCategories {Array} array of app categories
- * @param aRegistryDir {String} (optional) path to the registry
- */
-function NativeApp(aApp, aManifest, aCategories, aRegistryDir) {
-  CommonNativeApp.call(this, aApp, aManifest, aCategories, aRegistryDir);
-
-  if (this.isPackaged) {
-    this.size = aApp.updateManifest.size / 1024;
-  }
-
-  this.webapprt = this.appNameAsFilename + ".exe";
-  this.configJson = "webapp.json";
-  this.webappINI = "webapp.ini";
-  this.iconPath = OS.Path.join("chrome", "icons", "default", "default.ico");
-  this.uninstallDir = "uninstall";
-  this.uninstallerFile = OS.Path.join(this.uninstallDir,
-                                      "webapp-uninstaller.exe");
-  this.shortcutLogsINI = OS.Path.join(this.uninstallDir, "shortcuts_log.ini");
-  this.zipFile = "application.zip";
-
-  this.backupFiles = [ "chrome", this.configJson, this.webappINI, "uninstall" ];
-  if (this.isPackaged) {
-    this.backupFiles.push(this.zipFile);
-  }
-
-  this.uninstallSubkeyStr = this.uniqueName;
-}
-
-NativeApp.prototype = {
-  __proto__: CommonNativeApp.prototype,
-  size: null,
-
-  /**
-   * Creates a native installation of the web app in the OS
-   *
-   * @param aManifest {Object} the manifest data provided by the web app
-   * @param aZipPath {String} path to the zip file for packaged apps (undefined
-   *                          for hosted apps)
-   */
-  install: Task.async(function*(aApp, aManifest, aZipPath) {
-    if (this._dryRun) {
-      return;
-    }
-
-    // If the application is already installed, this is a reinstallation.
-    if (WebappOSUtils.getInstallPath(aApp)) {
-      return yield this.prepareUpdate(aApp, aManifest, aZipPath);
-    }
-
-    this._setData(aApp, aManifest);
-
-    let installDir = OS.Path.join(APP_DATA_DIR, this.uniqueName);
-
-    // Create a temporary installation directory.
-    let dir = getFile(TMP_DIR, this.uniqueName);
-    dir.createUnique(Ci.nsIFile.DIRECTORY_TYPE, PERMS_DIRECTORY);
-    let tmpDir = dir.path;
-
-    // Perform the installation in the temp directory.
-    try {
-      yield this._createDirectoryStructure(tmpDir);
-      yield this._getShortcutName(installDir);
-      yield this._copyWebapprt(tmpDir);
-      yield this._copyUninstaller(tmpDir);
-      yield this._createConfigFiles(tmpDir);
-
-      if (aZipPath) {
-        yield OS.File.move(aZipPath, OS.Path.join(tmpDir, this.zipFile));
-      }
-
-      yield this._getIcon(tmpDir);
-    } catch (ex) {
-      yield OS.File.removeDir(tmpDir, { ignoreAbsent: true });
-      throw ex;
-    }
-
-    // Apply the installation.
-    this._removeInstallation(true, installDir);
-
-    try {
-      yield this._applyTempInstallation(tmpDir, installDir);
-    } catch (ex) {
-      this._removeInstallation(false, installDir);
-      yield OS.File.removeDir(tmpDir, { ignoreAbsent: true });
-      throw ex;
-    }
-  }),
-
-  /**
-   * Creates an update in a temporary directory to be applied later.
-   *
-   * @param aManifest {Object} the manifest data provided by the web app
-   * @param aZipPath {String} path to the zip file for packaged apps (undefined
-   *                          for hosted apps)
-   */
-  prepareUpdate: Task.async(function*(aApp, aManifest, aZipPath) {
-    if (this._dryRun) {
-      return;
-    }
-
-    this._setData(aApp, aManifest);
-
-    let installDir = WebappOSUtils.getInstallPath(aApp);
-    if (!installDir) {
-      throw ERR_NOT_INSTALLED;
-    }
-
-    if (this.uniqueName != OS.Path.basename(installDir)) {
-      // Bug 919799: If the app is still in the registry, migrate its data to
-      // the new format.
-      throw ERR_UPDATES_UNSUPPORTED_OLD_NAMING_SCHEME;
-    }
-
-    let updateDir = OS.Path.join(installDir, "update");
-    yield OS.File.removeDir(updateDir, { ignoreAbsent: true });
-    yield OS.File.makeDir(updateDir);
-
-    // Perform the update in the "update" subdirectory.
-    try {
-      yield this._createDirectoryStructure(updateDir);
-      yield this._getShortcutName(installDir);
-      yield this._copyUninstaller(updateDir);
-      yield this._createConfigFiles(updateDir);
-
-      if (aZipPath) {
-        yield OS.File.move(aZipPath, OS.Path.join(updateDir, this.zipFile));
-      }
-
-      yield this._getIcon(updateDir);
-    } catch (ex) {
-      yield OS.File.removeDir(updateDir, { ignoreAbsent: true });
-      throw ex;
-    }
-  }),
-
-  /**
-   * Applies an update.
-   */
-  applyUpdate: Task.async(function*(aApp) {
-    if (this._dryRun) {
-      return;
-    }
-
-    let installDir = WebappOSUtils.getInstallPath(aApp);
-    let updateDir = OS.Path.join(installDir, "update");
-
-    yield this._getShortcutName(installDir);
-
-    let backupDir = yield this._backupInstallation(installDir);
-
-    try {
-      yield this._applyTempInstallation(updateDir, installDir);
-    } catch (ex) {
-      yield this._restoreInstallation(backupDir, installDir);
-      throw ex;
-    } finally {
-      yield OS.File.removeDir(backupDir, { ignoreAbsent: true });
-      yield OS.File.removeDir(updateDir, { ignoreAbsent: true });
-    }
-  }),
-
-  _applyTempInstallation: Task.async(function*(aTmpDir, aInstallDir) {
-    yield moveDirectory(aTmpDir, aInstallDir);
-
-    this._createShortcutFiles(aInstallDir);
-    this._writeSystemKeys(aInstallDir);
-  }),
-
-  _getShortcutName: Task.async(function*(aInstallDir) {
-    let shortcutLogsINIfile = getFile(aInstallDir, this.shortcutLogsINI);
-
-    if (shortcutLogsINIfile.exists()) {
-      // If it's a reinstallation (or an update) get the shortcut names
-      // from the shortcut_log.ini file
-      let parser = Cc["@mozilla.org/xpcom/ini-processor-factory;1"].
-                   getService(Ci.nsIINIParserFactory).
-                   createINIParser(shortcutLogsINIfile);
-      this.shortcutName = parser.getString("STARTMENU", "Shortcut0");
-    } else {
-      // Check in both directories to see if a shortcut with the same name
-      // already exists.
-      this.shortcutName = yield getAvailableFileName([ PROGS_DIR, DESKTOP_DIR ],
-                                                     this.appNameAsFilename,
-                                                     ".lnk");
-    }
-  }),
-
-  /**
-   * Remove the current installation
-   */
-  _removeInstallation: function(keepProfile, aInstallDir) {
-    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(this.uninstallSubkeyStr)) {
-        uninstallKey.removeChild(this.uninstallSubkeyStr);
-      }
-    } catch (e) {
-    } finally {
-      if (uninstallKey) {
-        uninstallKey.close();
-      }
-    }
-
-    let filesToRemove = [ OS.Path.join(DESKTOP_DIR, this.shortcutName),
-                          OS.Path.join(PROGS_DIR, this.shortcutName) ];
-
-    if (keepProfile) {
-      for (let filePath of this.backupFiles) {
-        filesToRemove.push(OS.Path.join(aInstallDir, filePath));
-      }
-
-      filesToRemove.push(OS.Path.join(aInstallDir, this.webapprt));
-    } else {
-      filesToRemove.push(aInstallDir);
-    }
-
-    removeFiles(filesToRemove);
-  },
-
-  _backupInstallation: Task.async(function*(aInstallDir) {
-    let backupDir = OS.Path.join(aInstallDir, "backup");
-    yield OS.File.removeDir(backupDir, { ignoreAbsent: true });
-    yield OS.File.makeDir(backupDir);
-
-    for (let filePath of this.backupFiles) {
-      yield OS.File.move(OS.Path.join(aInstallDir, filePath),
-                         OS.Path.join(backupDir, filePath));
-    }
-
-    return backupDir;
-  }),
-
-  _restoreInstallation: function(aBackupDir, aInstallDir) {
-    return moveDirectory(aBackupDir, aInstallDir);
-  },
-
-  /**
-   * Creates the main directory structure.
-   */
-  _createDirectoryStructure: Task.async(function*(aDir) {
-    yield OS.File.makeDir(OS.Path.join(aDir, this.uninstallDir));
-
-    yield OS.File.makeDir(OS.Path.join(aDir, OS.Path.dirname(this.iconPath)),
-                          { from: aDir });
-  }),
-
-  /**
-   * Copy the webrt executable into the installation directory.
-   */
-  _copyWebapprt: function(aDir) {
-    return OS.File.copy(OS.Path.join(this.runtimeFolder, "webapprt-stub.exe"),
-                        OS.Path.join(aDir, this.webapprt));
-  },
-
-  /**
-   * Copy the uninstaller executable into the installation directory.
-   */
-  _copyUninstaller: function(aDir) {
-    return OS.File.copy(OS.Path.join(this.runtimeFolder, "webapp-uninstaller.exe"),
-                        OS.Path.join(aDir, this.uninstallerFile));
-  },
-
-  /**
-   * Creates the configuration files into their destination folders.
-   */
-  _createConfigFiles: function(aDir) {
-    // ${InstallDir}/webapp.json
-    yield writeToFile(OS.Path.join(aDir, this.configJson),
-                      JSON.stringify(this.webappJson));
-
-    let factory = Cc["@mozilla.org/xpcom/ini-processor-factory;1"].
-                  getService(Ci.nsIINIParserFactory);
-
-    // ${InstallDir}/webapp.ini
-    let webappINIfile = getFile(aDir, this.webappINI);
-
-    let writer = factory.createINIParser(webappINIfile)
-                        .QueryInterface(Ci.nsIINIParserWriter);
-    writer.setString("Webapp", "Name", this.appLocalizedName);
-    writer.setString("Webapp", "Profile", this.uniqueName);
-    writer.setString("Webapp", "Executable", this.appNameAsFilename);
-    writer.setString("WebappRT", "InstallDir", this.runtimeFolder);
-    writer.writeFile(null, Ci.nsIINIParserWriter.WRITE_UTF16);
-
-    let shortcutLogsINIfile = getFile(aDir, this.shortcutLogsINI);
-
-    writer = factory.createINIParser(shortcutLogsINIfile)
-                    .QueryInterface(Ci.nsIINIParserWriter);
-    writer.setString("STARTMENU", "Shortcut0", this.shortcutName);
-    writer.setString("DESKTOP", "Shortcut0", this.shortcutName);
-    writer.setString("TASKBAR", "Migrated", "true");
-    writer.writeFile(null, Ci.nsIINIParserWriter.WRITE_UTF16);
-
-    // ${UninstallDir}/uninstall.log
-    let uninstallContent =
-      "File: \\webapp.ini\r\n" +
-      "File: \\webapp.json\r\n" +
-      "File: \\webapprt.old\r\n" +
-      "File: \\chrome\\icons\\default\\default.ico";
-    if (this.isPackaged) {
-      uninstallContent += "\r\nFile: \\application.zip";
-    }
-
-    yield writeToFile(OS.Path.join(aDir, this.uninstallDir, "uninstall.log"),
-                      uninstallContent);
-  },
-
-  /**
-   * Writes the keys to the system registry that are necessary for the app
-   * operation and uninstall process.
-   */
-  _writeSystemKeys: function(aInstallDir) {
-    let parentKey;
-    let uninstallKey;
-    let subKey;
-
-    try {
-      parentKey = Cc["@mozilla.org/windows-registry-key;1"].
-                  createInstance(Ci.nsIWindowsRegKey);
-      parentKey.open(parentKey.ROOT_KEY_CURRENT_USER,
-                     "SOFTWARE\\Microsoft\\Windows\\CurrentVersion",
-                     parentKey.ACCESS_WRITE);
-      uninstallKey = parentKey.createChild("Uninstall", parentKey.ACCESS_WRITE)
-      subKey = uninstallKey.createChild(this.uninstallSubkeyStr,
-                                        uninstallKey.ACCESS_WRITE);
-
-      subKey.writeStringValue("DisplayName", this.appLocalizedName);
-
-      let uninstallerPath = OS.Path.join(aInstallDir, this.uninstallerFile);
-
-      subKey.writeStringValue("UninstallString", '"' + uninstallerPath + '"');
-      subKey.writeStringValue("InstallLocation", '"' + aInstallDir + '"');
-      subKey.writeStringValue("AppFilename", this.appNameAsFilename);
-      subKey.writeStringValue("DisplayIcon", OS.Path.join(aInstallDir,
-                                                          this.iconPath));
-
-      let date = new Date();
-      let year = date.getYear().toString();
-      let month = date.getMonth();
-      if (month < 10) {
-        month = "0" + month;
-      }
-      let day = date.getDate();
-      if (day < 10) {
-        day = "0" + day;
-      }
-      subKey.writeStringValue("InstallDate", year + month + day);
-      if (this.version) {
-        subKey.writeStringValue("DisplayVersion", this.version);
-      }
-      if (this.developerName) {
-        subKey.writeStringValue("Publisher", this.developerName);
-      }
-      subKey.writeStringValue("URLInfoAbout", this.developerUrl);
-      if (this.size) {
-        subKey.writeIntValue("EstimatedSize", this.size);
-      }
-
-      subKey.writeIntValue("NoModify", 1);
-      subKey.writeIntValue("NoRepair", 1);
-    } catch(ex) {
-      throw ex;
-    } finally {
-      if(subKey) subKey.close();
-      if(uninstallKey) uninstallKey.close();
-      if(parentKey) parentKey.close();
-    }
-  },
-
-  /**
-   * Creates a shortcut file inside the app installation folder and makes
-   * two copies of it: one into the desktop and one into the start menu.
-   */
-  _createShortcutFiles: function(aInstallDir) {
-    let shortcut = getFile(aInstallDir, this.shortcutName).
-                      QueryInterface(Ci.nsILocalFileWin);
-
-    /* function nsILocalFileWin.setShortcut(targetFile, workingDir, args,
-                                            description, iconFile, iconIndex) */
-
-    shortcut.setShortcut(getFile(aInstallDir, this.webapprt),
-                         getFile(aInstallDir),
-                         null,
-                         this.shortDescription,
-                         getFile(aInstallDir, this.iconPath),
-                         0);
-
-    shortcut.copyTo(getFile(DESKTOP_DIR), this.shortcutName);
-    shortcut.copyTo(getFile(PROGS_DIR), this.shortcutName);
-
-    shortcut.followLinks = false;
-    shortcut.remove(false);
-  },
-
-  /**
-   * Process the icon from the imageStream as retrieved from
-   * the URL by getIconForApp(). This will save the icon to the
-   * topwindow.ico file.
-   *
-   * @param aMimeType     the icon mimetype
-   * @param aImageStream  the stream for the image data
-   * @param aDir          the directory where the icon should be stored
-   */
-  _processIcon: function(aMimeType, aImageStream, aDir) {
-    let deferred = Promise.defer();
-
-    let imgTools = Cc["@mozilla.org/image/tools;1"].
-                   createInstance(Ci.imgITools);
-
-    let imgContainer = imgTools.decodeImage(aImageStream, aMimeType);
-    let iconStream = imgTools.encodeImage(imgContainer,
-                                          "image/vnd.microsoft.icon",
-                                          "format=bmp;bpp=32");
-
-    let tmpIconFile = getFile(aDir, this.iconPath);
-
-    let outputStream = FileUtils.openSafeFileOutputStream(tmpIconFile);
-    NetUtil.asyncCopy(iconStream, outputStream, function(aResult) {
-      if (Components.isSuccessCode(aResult)) {
-        deferred.resolve();
-      } else {
-        deferred.reject("Failure copying icon: " + aResult);
-      }
-    });
-
-    return deferred.promise;
-  }
-}
deleted file mode 100644
--- a/toolkit/webapps/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-with Files('**'):
-    BUG_COMPONENT = ('Firefox', 'Web Apps')
-
-EXTRA_PP_JS_MODULES += [
-    'NativeApp.jsm',
-    'WebappOSUtils.jsm',
-]
-
-TEST_DIRS += ['tests']
-
-if CONFIG['MOZ_BUILD_APP'] == 'mobile/android':
-    DEFINES['MOZ_FENNEC'] = True
deleted file mode 100644
--- a/toolkit/webapps/tests/.eslintrc
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-  "extends": [
-    "../../../testing/mochitest/chrome.eslintrc"
-  ]
-}
deleted file mode 100644
--- a/toolkit/webapps/tests/Makefile.in
+++ /dev/null
@@ -1,5 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-PROGRAMS_DEST = $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)
deleted file mode 100644
--- a/toolkit/webapps/tests/TestWebappRT.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-int main(int argc, char *argv[]) {
-  return 42;
-}
deleted file mode 100644
--- a/toolkit/webapps/tests/app.sjs
+++ /dev/null
@@ -1,151 +0,0 @@
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
-
-function getQuery(request) {
-  let query = {};
-
-  request.queryString.split('&').forEach(function(val) {
-    let [name, value] = val.split('=');
-    query[name] = unescape(value);
-  });
-
-  return query;
-}
-
-function getTestFile(aName) {
-  var file = Services.dirsvc.get("CurWorkD", Ci.nsIFile);
-
-  var path = "chrome/toolkit/webapps/tests/data/app/" + aName;
-
-  path.split("/").forEach(function(component) {
-    file.append(component);
-  });
-
-  return file;
-}
-
-function readFile(aFile) {
-  var fstream = Cc["@mozilla.org/network/file-input-stream;1"].
-                createInstance(Ci.nsIFileInputStream);
-  fstream.init(aFile, -1, 0, 0);
-  var data = NetUtil.readInputStreamToString(fstream, fstream.available());
-  fstream.close();
-  return data;
-}
-
-function getHostedManifest(aVersion) {
-  return readFile(getTestFile("hosted_manifest.webapp")).
-           replace(/VERSION_TOKEN/g, aVersion);
-}
-
-function getManifest(aVersion) {
-  return readFile(getTestFile("manifest.webapp")).
-           replace(/VERSION_TOKEN/g, aVersion);
-}
-
-function buildAppPackage(aVersion) {
-  const PR_RDWR        = 0x04;
-  const PR_CREATE_FILE = 0x08;
-  const PR_TRUNCATE    = 0x20;
-
-  let zipFile = Services.dirsvc.get("TmpD", Ci.nsIFile);
-  zipFile.append("application.zip");
-
-  let zipWriter = Cc["@mozilla.org/zipwriter;1"].createInstance(Ci.nsIZipWriter);
-  zipWriter.open(zipFile, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE);
-
-  // Add index.html file to the zip file
-  zipWriter.addEntryFile("index.html",
-                         Ci.nsIZipWriter.COMPRESSION_NONE,
-                         getTestFile("index.html"),
-                         false);
-
-  // Add manifest to the zip file
-  var manStream = Cc["@mozilla.org/io/string-input-stream;1"].
-                  createInstance(Ci.nsIStringInputStream);
-  var manifest = getManifest(aVersion);
-  manStream.setData(manifest, manifest.length);
-  zipWriter.addEntryStream("manifest.webapp", Date.now(),
-                           Ci.nsIZipWriter.COMPRESSION_NONE,
-                           manStream, false);
-
-  zipWriter.close();
-
-  return readFile(zipFile);
-}
-
-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;
-  }
-
-  if ("setVersion" in query) {
-    setState("version", query.setVersion);
-    response.write("OK");
-    return;
-  }
-  var version = Number(getState("version"));
-
-  if ("getPackage" in query) {
-    response.setHeader("Content-Type", "application/zip", false);
-    response.write(buildAppPackage(version));
-
-    var getPackageQueries = Number(getState("getPackageQueries"));
-    setState("getPackageQueries", String(++getPackageQueries));
-
-    return;
-  }
-
-  if ("getPackageQueries" in query) {
-    response.setHeader("Content-Type", "text/plain", false);
-    response.write(String(Number(getState("getPackageQueries"))));
-    return;
-  }
-
-  if ("getManifest" in query) {
-    response.setHeader("Content-Type", "application/x-web-app-manifest+json", false);
-    response.write(getManifest(version));
-
-    var getManifestQueries = Number(getState("getManifestQueries"));
-    setState("getManifestQueries", String(++getManifestQueries));
-
-    return;
-  }
-
-  if ("getHostedManifest" in query) {
-    response.setHeader("Content-Type", "application/x-web-app-manifest+json", false);
-    response.write(getHostedManifest(version));
-
-    var getManifestQueries = Number(getState("getManifestQueries"));
-    setState("getManifestQueries", String(++getManifestQueries));
-
-    return;
-  }
-
-  if ("getManifestQueries" in query) {
-    response.setHeader("Content-Type", "text/plain", false);
-    response.write(String(Number(getState("getManifestQueries"))));
-    return;
-  }
-}
deleted file mode 100644
--- a/toolkit/webapps/tests/chrome.ini
+++ /dev/null
@@ -1,43 +0,0 @@
-[DEFAULT]
-# Disable these tests because this code depends on mozApps, which is no longer
-# enabled on the platforms this code supports (desktop, Android), so this code
-# is no longer used on any platform (and will be removed by bug 1245199).
-#skip-if = buildapp == 'mulet' || buildapp == 'b2g' || os == 'android' || os == "mac" && os_version == "10.6" # see bug 993690
-skip-if = true
-support-files =
-  head.js
-  app.sjs
-  data/*
-
-[test_custom_origin.xul]
-skip-if = asan
-[test_custom_origin_uninstall_install.xul]
-skip-if = asan || (os == 'mac' && os_version == '10.10') || os == 'win' # Bug 1123085, Bug 1059238 for Windows
-[test_install_appcache.xul]
-skip-if = asan
-[test_hosted.xul]
-[test_packaged.xul]
-[test_hosted_launch.xul]
-skip-if = asan
-[test_hosted_launch_no_registry.xul]
-skip-if = asan
-[test_packaged_launch.xul]
-skip-if = asan
-[test_packaged_launch_no_registry.xul]
-skip-if = asan
-[test_hosted_uninstall.xul]
-skip-if = (os == "win" && os_version == "5.1") || (os == 'mac' && os_version == '10.10') # WinXP: bug 981251; OS X 10.10: bug 1123085
-[test_packaged_uninstall.xul]
-skip-if = (os == "win" && os_version == "5.1") || (os == 'mac' && os_version == '10.10') # WinXP: bug 981251; OS X 10.10: bug 1123085
-[test_hosted_update_from_webapp_runtime.xul]
-skip-if = asan
-[test_packaged_update_from_webapp_runtime.xul]
-skip-if = asan
-[test_hosted_icons.xul]
-[test_hosted_checkforupdates_from_webapp_runtime.xul]
-skip-if = asan || (os == "win" && os_version == "6.2") # Win8: bug 1162987
-[test_packaged_icons.xul]
-[test_packaged_checkforupdates_from_webapp_runtime.xul]
-skip-if = asan || (os == "win" && os_version == "6.2") # Win8: bug 1154545
-[test_webapp_runtime_executable_update.xul]
-[test_non_ascii_app_name.xul]
deleted file mode 100644
index ddb90d8b8fd296d0f46fff1bf364d55cec915dac..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/toolkit/webapps/tests/data/app/hosted_manifest.webapp
+++ /dev/null
@@ -1,11 +0,0 @@
-{
-  "name" : "Test app",
-  "version" : "VERSION_TOKEN",
-  "description": "Test app",
-  "launch_path": "/chrome/toolkit/webapps/tests/app.sjs?appreq",
-  "developer": {
-    "name": "marco",
-    "url": "http://www.example.com/"
-  },
-  "default_locale": "en-US"
-}
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,12 +0,0 @@
-{
-  "name" : "Test app",
-  "version" : "VERSION_TOKEN",
-  "package_path": "app.sjs?getPackage=true",
-  "description": "Test app",
-  "launch_path": "/index.html",
-  "developer": {
-    "name": "marco",
-    "url": "http://www.example.com/"
-  },
-  "default_locale": "en-US"
-}
deleted file mode 100644
--- a/toolkit/webapps/tests/data/appcached_app/index.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<!DOCTYPE html>
-<html manifest="manifest.appcache">
-<head>
-<title>Test app</title>
-</head>
-<body>
-<script type="application/javascript">
-window.applicationCache.addEventListener('noupdate', function(aEvent) {
-  var iframe = document.getElementById('ifr');
-  iframe.src = "http://127.0.0.1:8888/chrome/toolkit/webapps/tests/app.sjs?appreq";
-}, false);
-</script>
-<iframe id="ifr"></iframe>
-</body>
-</html>
deleted file mode 100644
--- a/toolkit/webapps/tests/data/appcached_app/manifest.appcache
+++ /dev/null
@@ -1,3 +0,0 @@
-CACHE MANIFEST
-# Version 1
-/chrome/toolkit/webapps/tests/data/appcached_app/index.html
deleted file mode 100644
--- a/toolkit/webapps/tests/data/appcached_app/manifest.appcache^headers^
+++ /dev/null
@@ -1,1 +0,0 @@
-Content-Type: text/cache-manifest
deleted file mode 100644
--- a/toolkit/webapps/tests/data/appcached_app/manifest.webapp
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-  "name": "App using AppCache",
-  "launch_path": "/chrome/toolkit/webapps/tests/data/appcached_app/index.html",
-  "appcache_path": "/chrome/toolkit/webapps/tests/data/appcached_app/manifest.appcache"
-}
deleted file mode 100644
--- a/toolkit/webapps/tests/data/appcached_app/manifest.webapp^headers^
+++ /dev/null
@@ -1,1 +0,0 @@
-Content-Type: application/x-web-app-manifest+json
deleted file mode 100644
--- a/toolkit/webapps/tests/data/custom_origin.webapp
+++ /dev/null
@@ -1,9 +0,0 @@
-{
-  "name": "Custom Origin Test",
-  "version": 1,
-  "size": 777,
-  "package_path": "custom_origin.zip",
-  "launch_path": "/index.html",
-  "origin": "app://test.origin.privileged.app",
-  "type": "privileged"
-}
deleted file mode 100644
--- a/toolkit/webapps/tests/data/custom_origin.webapp^headers^
+++ /dev/null
@@ -1,1 +0,0 @@
-Content-Type: application/x-web-app-manifest+json
deleted file mode 100644
index 94d0d634548ce30242267538cbad0b135678d773..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index e9d5bbb4b29a5eb50de982bb66338e81d413364f..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/toolkit/webapps/tests/head.js
+++ /dev/null
@@ -1,592 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/WebappOSUtils.jsm");
-Cu.import("resource://gre/modules/NativeApp.jsm");
-
-const LINUX = navigator.platform.startsWith("Linux");
-const MAC = navigator.platform.startsWith("Mac");
-const WIN = navigator.platform.startsWith("Win");
-
-const PR_RDWR        = 0x04;
-const PR_CREATE_FILE = 0x08;
-const PR_TRUNCATE    = 0x20;
-
-function checkFiles(files) {
-  return Task.spawn(function*() {
-    for (let file of files) {
-      if (!(yield OS.File.exists(file))) {
-        info("File doesn't exist: " + file);
-        return false;
-      }
-    }
-
-    return true;
-  });
-}
-
-function checkDateHigherThan(files, date) {
-  return Task.spawn(function*() {
-    for (let file of files) {
-      if (!(yield OS.File.exists(file))) {
-        info("File doesn't exist: " + file);
-        return false;
-      }
-
-      let stat = yield OS.File.stat(file);
-      if (!(stat.lastModificationDate > date)) {
-        info("File not newer: " + file);
-        return false;
-      }
-    }
-
-    return true;
-  });
-}
-
-function dirContainsOnly(dir, expectedFiles) {
-  return Task.spawn(function*() {
-    let iterator = new OS.File.DirectoryIterator(dir);
-
-    let entries;
-    try {
-      entries = yield iterator.nextBatch();
-    } finally {
-      iterator.close();
-    }
-
-    let ret = true;
-
-    // Find unexpected files
-    for (let {path} of entries) {
-      if (expectedFiles.indexOf(path) == -1) {
-        info("Unexpected file: " + path);
-        ret = false;
-      }
-    }
-
-    // Find missing files
-    for (let expectedPath of expectedFiles) {
-      if (entries.findIndex(({path}) => path == expectedPath) == -1) {
-        info("Missing file: " + expectedPath);
-        ret = false;
-      }
-    }
-
-    return ret;
-  });
-}
-
-var dirSize = Task.async(function*(aDir) {
-  let iterator = new OS.File.DirectoryIterator(aDir);
-
-  let entries;
-  try {
-    entries = yield iterator.nextBatch();
-  } finally {
-    iterator.close();
-  }
-
-  let size = 0;
-
-  for (let entry of entries) {
-    if (entry.isDir) {
-      size += yield dirSize(entry.path);
-    } else {
-      let stat = yield OS.File.stat(entry.path);
-      size += stat.size;
-    }
-  }
-
-  return size;
-});
-
-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;
-}
-
-function setDryRunPref() {
-  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);
-    }
-  });
-}
-
-function TestAppInfo(aApp, aIsPackaged) {
-  this.appProcess = Cc["@mozilla.org/process/util;1"].
-                    createInstance(Ci.nsIProcess);
-
-  this.isPackaged = aIsPackaged;
-
-  this.uniqueName = WebappOSUtils.getUniqueName(aApp);
-
-  if (LINUX) {
-    this.installPath = OS.Path.join(OS.Constants.Path.homeDir,
-                                    "." + this.uniqueName);
-    this.exePath = OS.Path.join(this.installPath, "webapprt-stub");
-
-    this.iconFile = OS.Path.join(this.installPath, "icon.png");
-
-    this.webappINI = OS.Path.join(this.installPath, "webapp.ini");
-
-    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");
-    }
-
-    this.desktopINI = OS.Path.join(xdg_data_home, "applications",
-                                  "owa-" + this.uniqueName + ".desktop");
-
-    this.installedFiles = [
-      OS.Path.join(this.installPath, "webapp.json"),
-      this.webappINI,
-      this.iconFile,
-      this.exePath,
-      this.desktopINI,
-    ];
-    this.tempUpdatedFiles = [
-      OS.Path.join(this.installPath, "update", "icon.png"),
-      OS.Path.join(this.installPath, "update", "webapp.json"),
-      OS.Path.join(this.installPath, "update", "webapp.ini"),
-    ];
-    this.updatedFiles = [
-      OS.Path.join(this.installPath, "webapp.json"),
-      this.webappINI,
-      this.iconFile,
-      this.desktopINI,
-    ];
-
-    if (this.isPackaged) {
-      let appZipPath = OS.Path.join(this.installPath, "application.zip");
-      this.installedFiles.push(appZipPath);
-      this.tempUpdatedFiles.push(appZipPath);
-      this.updatedFiles.push(appZipPath);
-    }
-
-    this.profileRoot = this.installPath;
-    this.cacheRoot = OS.Path.join(OS.Constants.Path.homeDir, ".cache",
-                                  this.uniqueName);
-
-    this.cleanup = Task.async(function*() {
-      if (this.appProcess && this.appProcess.isRunning) {
-        this.appProcess.kill();
-      }
-
-      yield OS.File.removeDir(this.cacheRoot, { ignoreAbsent: true });
-
-      yield OS.File.removeDir(this.profileRoot, { ignoreAbsent: true });
-
-      yield OS.File.removeDir(this.installPath, { ignoreAbsent: true });
-
-      yield OS.File.remove(this.desktopINI, { ignoreAbsent: true });
-    });
-  } else if (WIN) {
-    this.installPath = OS.Path.join(OS.Constants.Path.winAppDataDir,
-                                    this.uniqueName);
-    this.exePath = OS.Path.join(this.installPath, aApp.name + ".exe");
-
-    this.iconFile = OS.Path.join(this.installPath, "chrome", "icons", "default", "default.ico");
-
-    this.webappINI = OS.Path.join(this.installPath, "webapp.ini");
-
-    let desktopShortcut = OS.Path.join(OS.Constants.Path.desktopDir,
-                                       aApp.name + ".lnk");
-    let startMenuShortcut = OS.Path.join(OS.Constants.Path.winStartMenuProgsDir,
-                                         aApp.name + ".lnk");
-
-    this.installedFiles = [
-      OS.Path.join(this.installPath, "webapp.json"),
-      this.webappINI,
-      OS.Path.join(this.installPath, "uninstall", "shortcuts_log.ini"),
-      OS.Path.join(this.installPath, "uninstall", "uninstall.log"),
-      OS.Path.join(this.installPath, "uninstall", "webapp-uninstaller.exe"),
-      this.iconFile,
-      this.exePath,
-      desktopShortcut,
-      startMenuShortcut,
-    ];
-    this.tempUpdatedFiles = [
-      OS.Path.join(this.installPath, "update", "chrome", "icons", "default", "default.ico"),
-      OS.Path.join(this.installPath, "update", "webapp.json"),
-      OS.Path.join(this.installPath, "update", "webapp.ini"),
-      OS.Path.join(this.installPath, "update", "uninstall", "shortcuts_log.ini"),
-      OS.Path.join(this.installPath, "update", "uninstall", "uninstall.log"),
-      OS.Path.join(this.installPath, "update", "uninstall", "webapp-uninstaller.exe"),
-    ];
-    this.updatedFiles = [
-      OS.Path.join(this.installPath, "webapp.json"),
-      this.webappINI,
-      OS.Path.join(this.installPath, "uninstall", "shortcuts_log.ini"),
-      OS.Path.join(this.installPath, "uninstall", "uninstall.log"),
-      this.iconFile,
-      desktopShortcut,
-      startMenuShortcut,
-    ];
-
-    if (this.isPackaged) {
-      let appZipPath = OS.Path.join(this.installPath, "application.zip");
-      this.installedFiles.push(appZipPath);
-      this.tempUpdatedFiles.push(appZipPath);
-      this.updatedFiles.push(appZipPath);
-    }
-
-    this.profileRoot = this.installPath;
-    this.cacheRoot = OS.Path.join(Services.dirsvc.get("LocalAppData", Ci.nsIFile).path,
-                                  this.uniqueName);
-
-    this.cleanup = Task.async(function*() {
-      if (this.appProcess && this.appProcess.isRunning) {
-        this.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(this.uniqueName)) {
-          uninstallKey.removeChild(this.uniqueName);
-        }
-      } catch (e) {
-      } finally {
-        if (uninstallKey) {
-          uninstallKey.close();
-        }
-      }
-
-      let removed = false;
-      do {
-        try {
-          yield OS.File.removeDir(this.cacheRoot, { ignoreAbsent: true });
-
-          yield OS.File.removeDir(this.profileRoot, { ignoreAbsent: true });
-
-          yield OS.File.removeDir(this.installPath, { ignoreAbsent: true });
-
-          yield OS.File.remove(desktopShortcut, { ignoreAbsent: true });
-          yield OS.File.remove(startMenuShortcut, { ignoreAbsent: true });
-
-          removed = true;
-        } catch (ex if ex instanceof OS.File.Error &&
-                 (ex.winLastError == OS.Constants.Win.ERROR_ACCESS_DENIED ||
-                  ex.winLastError == OS.Constants.Win.ERROR_SHARING_VIOLATION ||
-                  ex.winLastError == OS.Constants.Win.ERROR_DIR_NOT_EMPTY)) {
-          // Wait 100 ms before attempting to remove again.
-          yield wait(100);
-        }
-      } while (!removed);
-    });
-  } else if (MAC) {
-    this.installPath = OS.Path.join(OS.Constants.Path.homeDir,
-                                    "Applications",
-                                    aApp.name + ".app");
-    this.exePath = OS.Path.join(this.installPath, "Contents", "MacOS", "webapprt");
-
-    this.iconFile = OS.Path.join(this.installPath, "Contents", "Resources", "appicon.icns");
-
-    this.webappINI = OS.Path.join(this.installPath, "Contents", "MacOS", "webapp.ini");
-
-    let appProfileDir = OS.Path.join(OS.Constants.Path.macUserLibDir,
-                                     "Application Support",
-                                     this.uniqueName);
-
-    this.installedFiles = [
-      OS.Path.join(this.installPath, "Contents", "Info.plist"),
-      this.webappINI,
-      OS.Path.join(appProfileDir, "webapp.json"),
-      this.iconFile,
-      this.exePath,
-    ];
-    this.tempUpdatedFiles = [
-      OS.Path.join(this.installPath, "update", "Contents", "Info.plist"),
-      OS.Path.join(this.installPath, "update", "Contents", "MacOS", "webapp.ini"),
-      OS.Path.join(this.installPath, "update", "Contents", "Resources", "appicon.icns"),
-      OS.Path.join(this.installPath, "update", "webapp.json")
-    ];
-    this.updatedFiles = [
-      OS.Path.join(this.installPath, "Contents", "Info.plist"),
-      this.webappINI,
-      OS.Path.join(appProfileDir, "webapp.json"),
-      this.iconFile,
-    ];
-
-    if (this.isPackaged) {
-      let appZipPath = OS.Path.join(this.installPath, "Contents", "Resources", "application.zip");
-      this.installedFiles.push(appZipPath);
-      this.tempUpdatedFiles.push(appZipPath);
-      this.updatedFiles.push(appZipPath);
-    }
-
-    this.profileRoot = appProfileDir;
-    this.cacheRoot = OS.Path.join(OS.Constants.Path.macUserLibDir, "Caches",
-                                  this.uniqueName);
-
-    this.cleanup = Task.async(function*() {
-      if (this.appProcess && this.appProcess.isRunning) {
-        this.appProcess.kill();
-      }
-
-      yield OS.File.removeDir(this.cacheRoot, { ignoreAbsent: true });
-
-      yield OS.File.removeDir(this.profileRoot, { ignoreAbsent: true });
-
-      if (this.trashDir) {
-        yield OS.File.removeDir(this.trashDir, { ignoreAbsent: true });
-      }
-
-      yield OS.File.removeDir(this.installPath, { ignoreAbsent: true });
-
-      yield OS.File.removeDir(appProfileDir, { ignoreAbsent: true });
-    });
-  }
-
-  this.profilesIni = OS.Path.join(this.profileRoot, "profiles.ini");
-
-  let profileDir;
-
-  Object.defineProperty(this, "profileDir", {
-    get: function() {
-      if (!profileDir && this.profileRelPath) {
-        return getFile.apply(null, [this.profileRoot].concat(this.profileRelPath.split("/")));
-      }
-
-      return profileDir;
-    },
-    set: function(aVal) {
-      profileDir = aVal;
-    },
-  });
-
-  Object.defineProperty(this, "cacheDir", {
-    get: function() {
-      if (!this.profileRelPath) {
-        return null;
-      }
-
-      return getFile.apply(null, [this.cacheRoot].concat(this.profileRelPath.split("/")));
-    },
-  });
-
-  Object.defineProperty(this, "profileRelPath", {
-    get: function() {
-      // If the profileDir was set by someone else, use its leafName
-      // as the profile name.
-      if (profileDir) {
-        return profileDir.leafName;
-      }
-
-      // Otherwise, read profiles.ini to get the profile directory
-      try {
-        let iniParser = Cc["@mozilla.org/xpcom/ini-processor-factory;1"].
-                        getService(Ci.nsIINIParserFactory).
-                        createINIParser(getFile(this.profilesIni));
-        return iniParser.getString("Profile0", "Path");
-      } catch (e) {
-        return null;
-      }
-    }
-  });
-}
-
-function buildAppPackage(aManifest, aIconFile) {
-  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);
-
-  let manifestJSON = JSON.stringify(aManifest);
-  let manStream = Cc["@mozilla.org/io/string-input-stream;1"].
-                  createInstance(Ci.nsIStringInputStream);
-  manStream.setData(manifestJSON, manifestJSON.length);
-  zipWriter.addEntryStream("manifest.webapp", Date.now(),
-                           Ci.nsIZipWriter.COMPRESSION_NONE,
-                           manStream, false);
-
-  if (aIconFile) {
-    zipWriter.addEntryFile(aIconFile.leafName,
-                           Ci.nsIZipWriter.COMPRESSION_NONE,
-                           aIconFile,
-                           false);
-  }
-
-  zipWriter.close();
-
-  return zipFile.path;
-}
-
-function xhrRequest(aQueryString) {
-  let deferred = Promise.defer();
-
-  var xhr = new XMLHttpRequest();
-
-  xhr.addEventListener("load", function() {
-    deferred.resolve(xhr.responseText);
-  });
-
-  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' + aQueryString, true);
-  xhr.send();
-
-  return deferred.promise;
-}
-
-function wasAppSJSAccessed() {
-  return xhrRequest('?testreq').then((aResponseText) => {
-    return (aResponseText == 'done') ? true : false;
-  });
-}
-
-function setState(aVar, aState) {
-  return xhrRequest('?set' + aVar + '=' + aState).then((aResponseText) => {
-    is(aResponseText, "OK", "set" + aVar + " OK");
-  });
-}
-
-function getState(aVar) {
-  return xhrRequest('?get' + aVar);
-}
-
-function generateDataURI(aFile) {
-  var contentType = Cc["@mozilla.org/mime;1"].
-                    getService(Ci.nsIMIMEService).
-                    getTypeFromFile(aFile);
-
-  var inputStream = Cc["@mozilla.org/network/file-input-stream;1"].
-                    createInstance(Ci.nsIFileInputStream);
-  inputStream.init(aFile, -1, -1, Ci.nsIFileInputStream.CLOSE_ON_EOF);
-
-  var stream = Cc["@mozilla.org/binaryinputstream;1"].
-               createInstance(Ci.nsIBinaryInputStream);
-  stream.setInputStream(inputStream);
-
-  return "data:" + contentType + ";base64," +
-         btoa(stream.readBytes(stream.available()));
-}
-
-function confirmNextPopup() {
-  let popupPanel = window.top.QueryInterface(Ci.nsIInterfaceRequestor).
-                              getInterface(Ci.nsIWebNavigation).
-                              QueryInterface(Ci.nsIDocShell).
-                              chromeEventHandler.ownerDocument.defaultView.
-                              PopupNotifications.panel;
-
-  popupPanel.addEventListener("popupshown", function onPopupShown() {
-    popupPanel.removeEventListener("popupshown", onPopupShown, false);
-    this.childNodes[0].button.doCommand();
-  }, false);
-}
-
-var readJSON = Task.async(function*(aPath) {
-  let decoder = new TextDecoder();
-  let data = yield OS.File.read(aPath);
-  return JSON.parse(decoder.decode(data));
-});
-
-var setMacRootInstallDir = Task.async(function*(aPath) {
-  let oldRootInstallDir = NativeApp.prototype._rootInstallDir;
-
-  NativeApp.prototype._rootInstallDir = OS.Path.join(OS.Constants.Path.homeDir,
-                                                     "Applications");
-  yield OS.File.makeDir(NativeApp.prototype._rootInstallDir,
-                        { ignoreExisting: true });
-
-  SimpleTest.registerCleanupFunction(function() {
-    NativeApp.prototype._rootInstallDir = oldRootInstallDir;
-  });
-});
-
-var writeToFile = Task.async(function*(aPath, aData) {
-  let data = new TextEncoder().encode(aData);
-
-  let file;
-  try {
-    file = yield OS.File.open(aPath, { truncate: true, write: true }, { unixMode: 0o777 });
-    yield file.write(data);
-  } finally {
-    yield file.close();
-  }
-});
-
-// We need to mock the Alerts service, otherwise the alert that is shown
-// at the end of an installation makes the test leak the app's icon.
-
-const CID = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator).generateUUID();
-const ALERTS_SERVICE_CONTRACT_ID = "@mozilla.org/alerts-service;1";
-const ALERTS_SERVICE_CID = Components.ID(Cc[ALERTS_SERVICE_CONTRACT_ID].number);
-
-var AlertsService = {
-  classID: Components.ID(CID),
-
-  QueryInterface: XPCOMUtils.generateQI([Ci.nsIFactory,
-                                         Ci.nsIAlertsService]),
-
-  createInstance: function(aOuter, aIID) {
-    if (aOuter) {
-      throw Cr.NS_ERROR_NO_AGGREGATION;
-    }
-
-    return this.QueryInterface(aIID);
-  },
-
-  init: function() {
-    Components.manager.nsIComponentRegistrar.registerFactory(this.classID,
-      "", ALERTS_SERVICE_CONTRACT_ID, this);
-  },
-
-  restore: function() {
-    Components.manager.nsIComponentRegistrar.registerFactory(ALERTS_SERVICE_CID,
-      "", ALERTS_SERVICE_CONTRACT_ID, null);
-  },
-
-  showAlertNotification: function() {
-  },
-};
-
-AlertsService.init();
-
-SimpleTest.registerCleanupFunction(() => {
-  AlertsService.restore();
-});
-
-function prepareEnv(cb) {
-  SpecialPowers.pushPrefEnv({"set":[["dom.mozApps.debug", true]]}, cb);
-}
deleted file mode 100644
--- a/toolkit/webapps/tests/moz.build
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-MOCHITEST_CHROME_MANIFESTS += ['chrome.ini']
-SimplePrograms(['TestWebappRT'])
deleted file mode 100644
--- a/toolkit/webapps/tests/test_custom_origin.xul
+++ /dev/null
@@ -1,135 +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=1029674
--->
-<window title="Mozilla Bug 1029674"
-        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=1029674"
-     target="_blank">Mozilla Bug 1029674</a>
-  </body>
-
-<script type="application/javascript">
-<![CDATA[
-
-/** Test for Bug 1029674 **/
-
-"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 runTest = Task.async(function*() {
-  let manifest = yield readJSON(getTestFilePath("data/custom_origin.webapp"));
-
-  let app = {
-    name: manifest.name,
-    manifestURL: "http://test/chrome/toolkit/webapps/tests/data/custom_origin.webapp",
-    origin: "app://test.origin.privileged.app",
-  };
-
-  let testAppInfo = new TestAppInfo(app, true);
-
-  // Get to a clean state before the test
-  yield testAppInfo.cleanup();
-
-  SimpleTest.registerCleanupFunction(() => testAppInfo.cleanup());
-
-  setDryRunPref();
-
-  // Use the test root certificate for the test
-  Cu.import("resource://gre/modules/StoreTrustAnchor.jsm");
-  let oldIndex = TrustedRootCertificate.index;
-  TrustedRootCertificate.index = Ci.nsIX509CertDB.AppXPCShellRoot;
-
-  SimpleTest.registerCleanupFunction(function() {
-    TrustedRootCertificate.index = oldIndex;
-  });
-
-  // Allow signed apps to be installed from the test origin
-  let oldSignedAppOrigins;
-  try {
-    oldSignedAppOrigins = Services.prefs.getCharPref("dom.mozApps.signed_apps_installable_from");
-  } catch (ex) {}
-
-  let newSignedAppOrigins = oldSignedAppOrigins.concat(",chrome://mochitests");
-  Services.prefs.setCharPref("dom.mozApps.signed_apps_installable_from", newSignedAppOrigins);
-
-  SimpleTest.registerCleanupFunction(function() {
-    Services.prefs.setCharPref("dom.mozApps.signed_apps_installable_from", oldSignedAppOrigins);
-  });
-
-  // On Mac build servers, we don't have enough privileges to write to /Applications,
-  // so we install apps in a user-owned directory.
-  if (MAC) {
-    yield setMacRootInstallDir(OS.Path.join(OS.Constants.Path.homeDir, "Applications"));
-  }
-
-  confirmNextPopup();
-
-  let request = navigator.mozApps.installPackage(app.manifestURL);
-
-  {
-    let deferred = Promise.defer();
-    request.onerror = function() {
-      deferred.reject(this.error.name);
-    };
-    request.onsuccess = deferred.resolve;
-    yield deferred.promise;
-  }
-
-  let appObject = request.result;
-  ok(appObject, "app is non-null");
-
-  {
-    let deferred = Promise.defer();
-    appObject.ondownloaderror = function() {
-      deferred.reject(appObject.downloadError.name);
-    };
-    appObject.ondownloadapplied = deferred.resolve;
-    yield deferred.promise;
-  }
-
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-
-  let exeFile = getFile(testAppInfo.exePath);
-
-  ok(exeFile.isExecutable(), "webapprt executable is executable");
-
-  let appClosed = false;
-
-  testAppInfo.appProcess.init(exeFile)
-  testAppInfo.appProcess.runAsync([], 0, () => appClosed = true);
-
-  while (!(yield wasAppSJSAccessed()) && !appClosed) {
-    yield wait(1000);
-  }
-  ok(!appClosed, "App was launched and is still running");
-
-  SimpleTest.finish();
-});
-
-prepareEnv(() => runTest().catch((e) => {
-  ok(false, "Error during test: " + e);
-  SimpleTest.finish();
-}));
-
-]]>
-</script>
-</window>
deleted file mode 100644
--- a/toolkit/webapps/tests/test_custom_origin_uninstall_install.xul
+++ /dev/null
@@ -1,171 +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=1035282
--->
-<window title="Mozilla Bug 1035282"
-        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=1035282"
-     target="_blank">Mozilla Bug 1035282</a>
-  </body>
-
-<script type="application/javascript">
-<![CDATA[
-
-/** Test for Bug 1035282 **/
-
-"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 runTest = Task.async(function*() {
-  let manifest = yield readJSON(getTestFilePath("data/custom_origin.webapp"));
-
-  let app = {
-    name: manifest.name,
-    manifestURL: "http://test/chrome/toolkit/webapps/tests/data/custom_origin.webapp",
-    origin: "app://test.origin.privileged.app",
-  };
-
-  let testAppInfo = new TestAppInfo(app, true);
-
-  // Get to a clean state before the test
-  yield testAppInfo.cleanup();
-
-  SimpleTest.registerCleanupFunction(() => testAppInfo.cleanup());
-
-  setDryRunPref();
-
-  // Use the test root certificate for the test
-  Cu.import("resource://gre/modules/StoreTrustAnchor.jsm");
-  let oldIndex = TrustedRootCertificate.index;
-  TrustedRootCertificate.index = Ci.nsIX509CertDB.AppXPCShellRoot;
-
-  SimpleTest.registerCleanupFunction(function() {
-    TrustedRootCertificate.index = oldIndex;
-  });
-
-  // Allow signed apps to be installed from the test origin
-  let oldSignedAppOrigins;
-  try {
-    oldSignedAppOrigins = Services.prefs.getCharPref("dom.mozApps.signed_apps_installable_from");
-  } catch (ex) {}
-
-  let newSignedAppOrigins = oldSignedAppOrigins.concat(",chrome://mochitests");
-  Services.prefs.setCharPref("dom.mozApps.signed_apps_installable_from", newSignedAppOrigins);
-
-  SimpleTest.registerCleanupFunction(function() {
-    Services.prefs.setCharPref("dom.mozApps.signed_apps_installable_from", oldSignedAppOrigins);
-  });
-
-  // On Mac build servers, we don't have enough privileges to write to /Applications,
-  // so we install apps in a user-owned directory.
-  if (MAC) {
-    yield setMacRootInstallDir(OS.Path.join(OS.Constants.Path.homeDir, "Applications"));
-  }
-
-  confirmNextPopup();
-
-  {
-    let request = navigator.mozApps.installPackage(app.manifestURL);
-    {
-      let deferred = Promise.defer();
-      request.onerror = function() {
-        deferred.reject(this.error.name);
-      };
-      request.onsuccess = deferred.resolve;
-      yield deferred.promise;
-    }
-
-    let appObject = request.result;
-    ok(appObject, "app is non-null");
-
-    {
-      let deferred = Promise.defer();
-      appObject.ondownloaderror = function() {
-        deferred.reject(appObject.downloadError.name);
-      };
-      appObject.ondownloadapplied = deferred.resolve;
-      yield deferred.promise;
-    }
-  }
-
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-
-  yield WebappOSUtils.uninstall(app)
-
-  is(WebappOSUtils.launch(app), false, "Launch fails");
-
-  confirmNextPopup();
-
-  {
-    let request = navigator.mozApps.installPackage(app.manifestURL);
-    {
-      let deferred = Promise.defer();
-      request.onerror = function() {
-        deferred.reject(this.error.name);
-      };
-      request.onsuccess = deferred.resolve;
-      yield deferred.promise;
-    }
-
-    let appObject = request.result;
-    ok(appObject, "app is non-null");
-
-    {
-      let deferred = Promise.defer();
-      appObject.ondownloaderror = function() {
-        deferred.reject(appObject.downloadError.name);
-      };
-      appObject.ondownloadapplied = deferred.resolve;
-      yield deferred.promise;
-    }
-  }
-
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-
-  let exeFile = getFile(testAppInfo.exePath);
-
-  ok(exeFile.isExecutable(), "webapprt executable is executable");
-
-  let appClosed = false;
-
-  testAppInfo.appProcess.init(exeFile)
-  testAppInfo.appProcess.runAsync([], 0, () => appClosed = true);
-
-  while (!(yield wasAppSJSAccessed()) && !appClosed) {
-    yield wait(1000);
-  }
-  ok(!appClosed, "App was launched and is still running");
-
-  SimpleTest.finish();
-});
-
-prepareEnv(() => runTest().catch((e) => {
-  ok(false, "Error during test: " + e);
-  SimpleTest.finish();
-}));
-
-]]>
-</script>
-</window>
deleted file mode 100644
--- a/toolkit/webapps/tests/test_hosted.xul
+++ /dev/null
@@ -1,157 +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=898647
--->
-<window title="Mozilla Bug 898647"
-        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=898647"
-     target="_blank">Mozilla Bug 898647</a>
-  </body>
-
-<script type="application/javascript">
-<![CDATA[
-
-/** Test for Bug 898647 **/
-
-"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");
-
-let manifest = {
-  name: "Sample hosted app",
-};
-
-let app = {
-  name: "Sample hosted app",
-  manifestURL: "http://example.com/sample.manifest",
-  manifest: manifest,
-  origin: "http://example.com/",
-  categories: [],
-  installOrigin: "http://example.com/",
-  receipts: [],
-  installTime: Date.now(),
-};
-
-let testAppInfo = new TestAppInfo(app);
-
-let runTest = Task.async(function*() {
-  // Get to a clean state before the test
-  yield testAppInfo.cleanup();
-
-  SimpleTest.registerCleanupFunction(() => testAppInfo.cleanup());
-
-  setDryRunPref();
-
-  let nativeApp = new NativeApp(app, manifest, app.categories);
-  ok(nativeApp, "NativeApp object created");
-
-  info("Test update for an uninstalled application");
-  try {
-    yield nativeApp.prepareUpdate(app, manifest);
-    ok(false, "Didn't thrown");
-  } catch (ex) {
-    is(ex, "The application isn't installed", "Exception thrown");
-  }
-
-  testAppInfo.profileDir = nativeApp.createProfile();
-  ok(testAppInfo.profileDir && testAppInfo.profileDir.exists(), "Profile directory created");
-  ok((yield OS.File.exists(testAppInfo.profilesIni)), "profiles.ini file created");
-
-  // On Mac build servers, we don't have enough privileges to write to /Applications,
-  // so we install apps in a user-owned directory.
-  if (MAC) {
-    yield setMacRootInstallDir(OS.Path.join(OS.Constants.Path.homeDir, "Applications"));
-  }
-
-  // Install application
-  info("Test installation");
-  yield nativeApp.install(app, manifest);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-  ok((yield checkFiles(testAppInfo.installedFiles)), "Files correctly written");
-  is(WebappOSUtils.getInstallPath(app), testAppInfo.installPath, "getInstallPath == installPath");
-
-  let stat = yield OS.File.stat(testAppInfo.installPath);
-  let installTime = stat.lastModificationDate;
-
-  // Wait one second, otherwise the last modification date is the same.
-  yield wait(1000);
-
-  // Reinstall application
-  info("Test reinstallation");
-  yield nativeApp.install(app, manifest);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-  ok((yield checkFiles(testAppInfo.installedFiles)), "Installation not corrupted");
-  ok((yield checkFiles(testAppInfo.tempUpdatedFiles)), "Files correctly written in the update subdirectory");
-
-  yield nativeApp.applyUpdate(app);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-
-  if (MAC) {
-    stat = yield OS.File.stat(testAppInfo.webappINI);
-    is(stat.unixMode, 0o644, "Configuration file permissions correct");
-  } else if (LINUX) {
-    stat = yield OS.File.stat(testAppInfo.desktopINI);
-    is(stat.unixMode, 0o744, "Configuration file permissions correct");
-  }
-
-  ok((yield checkFiles(testAppInfo.installedFiles)), "Installation not corrupted");
-  ok(!(yield OS.File.exists(OS.Path.join(testAppInfo.installPath, "update"))), "Update directory removed");
-  ok((yield checkDateHigherThan(testAppInfo.updatedFiles, installTime)), "Modification date higher");
-
-  stat = yield OS.File.stat(testAppInfo.installPath);
-  installTime = stat.lastModificationDate;
-
-  // Wait one second, otherwise the last modification date is the same.
-  yield wait(1000);
-
-  // Update application
-  info("Test update");
-  yield nativeApp.prepareUpdate(app, manifest);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-  ok((yield checkFiles(testAppInfo.installedFiles)), "Installation not corrupted");
-  ok((yield checkFiles(testAppInfo.tempUpdatedFiles)), "Files correctly written in the update subdirectory");
-
-  yield nativeApp.applyUpdate(app);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-  ok((yield checkFiles(testAppInfo.installedFiles)), "Installation not corrupted");
-  ok(!(yield OS.File.exists(OS.Path.join(testAppInfo.installPath, "update"))), "Update directory removed");
-  ok((yield checkDateHigherThan(testAppInfo.updatedFiles, installTime)), "Modification date higher");
-
-  SimpleTest.finish();
-});
-
-prepareEnv(() => runTest().catch((e) => {
-  ok(false, "Error during test: " + e);
-  SimpleTest.finish();
-}));
-
-]]>
-</script>
-</window>
deleted file mode 100644
--- a/toolkit/webapps/tests/test_hosted_checkforupdates_from_webapp_runtime.xul
+++ /dev/null
@@ -1,116 +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=1036717
--->
-<window title="Mozilla Bug 1036717"
-        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=1036717"
-     target="_blank">Mozilla Bug 1036717</a>
-  </body>
-
-<script type="application/javascript">
-<![CDATA[
-
-/** Test for Bug 1036717 **/
-
-"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 runTest = Task.async(function*() {
-  let manifest = yield readJSON(getTestFilePath("data/app/hosted_manifest.webapp"));
-
-  let app = {
-    name: manifest.name,
-    manifestURL: "http://127.0.0.1:8888/chrome/toolkit/webapps/tests/app.sjs?getHostedManifest=true",
-    origin: "http://127.0.0.1:8888",
-  };
-
-  let testAppInfo = new TestAppInfo(app, true);
-
-  // Get to a clean state before the test
-  yield testAppInfo.cleanup();
-
-  SimpleTest.registerCleanupFunction(() => testAppInfo.cleanup());
-
-  setDryRunPref();
-
-  // On Mac build servers, we don't have enough privileges to write to /Applications,
-  // so we install apps in a user-owned directory.
-  if (MAC) {
-    yield setMacRootInstallDir(OS.Path.join(OS.Constants.Path.homeDir, "Applications"));
-  }
-
-  confirmNextPopup();
-
-  yield setState("Version", 1);
-
-  let request = navigator.mozApps.install(app.manifestURL);
-
-  {
-    let deferred = Promise.defer();
-    request.onerror = function() {
-      deferred.reject(this.error.name);
-    };
-    request.onsuccess = deferred.resolve;
-    yield deferred.promise;
-  }
-
-  let appObject = request.result;
-  ok(appObject, "app is non-null");
-
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-
-  // Force the update timer to fire in 1 second
-  let prefsFile = OS.Path.join(testAppInfo.profileDir.path, "prefs.js");
-  yield writeToFile(prefsFile, "user_pref(\"webapprt.app_update_interval\", 1);");
-
-  // Update app version
-  yield setState("Version", 2);
-
-  // Launch the webapprt executable that will verify the presence of an update
-  let exeFile = getFile(testAppInfo.exePath);
-
-  let appClosed = false;
-
-  testAppInfo.appProcess.init(exeFile)
-  testAppInfo.appProcess.runAsync([], 0, () => appClosed = true);
-
-  // If there was a second request to get the manifest, then the webapprt
-  // has searched for an update.
-  while (Number(yield getState("ManifestQueries")) < 2 &&
-         !appClosed) {
-    yield wait(1000);
-  }
-  ok(!appClosed, "App was launched and is still running");
-  ok(Number(yield getState("ManifestQueries")) >= 2, "Two manifest requests");
-
-  SimpleTest.finish();
-});
-
-prepareEnv(() => runTest().catch((e) => {
-  ok(false, "Error during test: " + e);
-  SimpleTest.finish();
-}));
-
-]]>
-</script>
-</window>
deleted file mode 100644
--- a/toolkit/webapps/tests/test_hosted_icons.xul
+++ /dev/null
@@ -1,157 +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=898647
--->
-<window title="Mozilla Bug 898647"
-        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=898647"
-     target="_blank">Mozilla Bug 898647</a>
-  </body>
-
-<script type="application/javascript">
-<![CDATA[
-
-/** Test for Bug 898647 **/
-
-"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");
-
-let manifest = {
-  name: "Sample hosted app",
-};
-
-let app = {
-  name: "Sample hosted app",
-  manifestURL: "http://example.com/sample.manifest",
-  manifest: manifest,
-  origin: "http://example.com/",
-  categories: [],
-  installOrigin: "http://example.com/",
-  receipts: [],
-  installTime: Date.now(),
-};
-
-let iconTests = [
-  // No icon specified
-  {},
-  // Absolute URI
-  {"32": "http://example.com/chrome/toolkit/webapps/tests/data/icon.png"},
-  // Relative URI
-  {"32": "/chrome/toolkit/webapps/tests/data/icon.png"},
-  // Data URI icon
-  {"32": generateDataURI(getFile(getTestFilePath("data/icon.png"))) },
-  // URI to a file that isn't an image
-  {"32": "/chrome/toolkit/webapps/tests/data/app/index.html"},
-  // Large icon that won't be used on Windows (bug #1152597)
-  {"512": "/chrome/toolkit/webapps/tests/data/512.png"},
-];
-
-// This is an array of the icon sizes associated with the elements of
-// iconTests. Each element in the iconSizes array is an array of two values:
-//  - The expected size of the icon
-//  - An epsilon value that defines an accepted range around the icon size.
-// On each platform the size is different (because the format of the file is
-// different: ICO on Windows, PNG on Linux, ICNS on Mac).
-// The epsilon value is 0 on Windows and Linux, where the size of the file
-// is precise (because we convert the icons with our own code). It is ~0 on
-// Mac because we use SIPS to convert the icon, and its output isn't
-// the same across Mac versions.
-
-let iconSizes;
-
-if (LINUX) {
-  iconSizes = [
-    [4009, 0],
-    [2787, 0],
-    [2787, 0],
-    [2787, 0],
-    [4009, 0],
-    [2195, 0],
-  ];
-} else if (WIN) {
-  iconSizes = [
-    [16958, 0],
-    [4286, 0],
-    [4286, 0],
-    [4286, 0],
-    [16958, 0],
-    // Windows ICO doesn't support 512x512 icons. The default should be chosen.
-    [16958, 0],
-  ];
-} else if (MAC) {
-  iconSizes = [
-    [14000, 2000],
-    [27000, 2000],
-    [27000, 2000],
-    [27000, 2000],
-    [14000, 2000],
-    [1000, 2000],
-  ];
-}
-
-let testAppInfo = new TestAppInfo(app);
-
-let runTest = Task.async(function*() {
-  SimpleTest.registerCleanupFunction(() => testAppInfo.cleanup());
-
-  setDryRunPref();
-
-  for (let curTest = 0; curTest < iconTests.length; curTest++) {
-    // Get to a clean state before the test
-    yield testAppInfo.cleanup();
-
-    manifest.icons = iconTests[curTest];
-    info("Test icon: " + JSON.stringify(manifest.icons));
-
-    let nativeApp = new NativeApp(app, manifest, app.categories);
-    ok(nativeApp, "NativeApp object created");
-
-    testAppInfo.profileDir = nativeApp.createProfile();
-    ok(testAppInfo.profileDir && testAppInfo.profileDir.exists(), "Profile directory created");
-    ok((yield OS.File.exists(testAppInfo.profilesIni)), "profiles.ini file created");
-
-    // On Mac build servers, we don't have enough privileges to write to /Applications,
-    // so we install apps in a user-owned directory.
-    if (MAC) {
-      yield setMacRootInstallDir(OS.Path.join(OS.Constants.Path.homeDir, "Applications"));
-    }
-
-    // Install application
-    info("Test installation");
-    yield nativeApp.install(app, manifest);
-    while (!WebappOSUtils.isLaunchable(app)) {
-      yield wait(1000);
-    }
-    ok(true, "App launchable");
-
-    let stat = yield OS.File.stat(testAppInfo.iconFile);
-    isfuzzy(stat.size, iconSizes[curTest][0], iconSizes[curTest][1],
-            "Icon size correct");
-  }
-
-  SimpleTest.finish();
-});
-
-prepareEnv(() => runTest().catch((e) => {
-  ok(false, "Error during test: " + e);
-  SimpleTest.finish();
-}));
-
-]]>
-</script>
-</window>
deleted file mode 100644
--- a/toolkit/webapps/tests/test_hosted_launch.xul
+++ /dev/null
@@ -1,103 +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 testAppInfo = new TestAppInfo(app);
-
-let runTest = Task.async(function*() {
-  // Get to a clean state before the test
-  yield testAppInfo.cleanup();
-
-  SimpleTest.registerCleanupFunction(() => testAppInfo.cleanup());
-
-  setDryRunPref();
-
-  let nativeApp = new NativeApp(app, manifest, app.categories);
-  ok(nativeApp, "NativeApp object created");
-
-  testAppInfo.profileDir = nativeApp.createProfile();
-  ok(testAppInfo.profileDir && testAppInfo.profileDir.exists(), "Profile directory created");
-
-  // On Mac build servers, we don't have enough privileges to write to /Applications,
-  // so we install apps in a user-owned directory.
-  if (MAC) {
-    yield setMacRootInstallDir(OS.Path.join(OS.Constants.Path.homeDir, "Applications"));
-  }
-
-  // Install application
-  info("Test installation");
-  yield nativeApp.install(app, manifest);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-
-  let exeFile = getFile(testAppInfo.exePath);
-
-  ok(exeFile.isExecutable(), "webapprt executable is executable");
-
-  let appClosed = false;
-
-  testAppInfo.appProcess.init(exeFile)
-  testAppInfo.appProcess.runAsync([], 0, () => appClosed = true);
-
-  while (!(yield wasAppSJSAccessed()) && !appClosed) {
-    yield wait(1000);
-  }
-  ok(!appClosed, "App was launched and is still running");
-
-  SimpleTest.finish();
-});
-
-prepareEnv(() => runTest().catch((e) => {
-  ok(false, "Error during test: " + e);
-  SimpleTest.finish();
-}));
-
-]]>
-</script>
-</window>
deleted file mode 100644
--- a/toolkit/webapps/tests/test_hosted_launch_no_registry.xul
+++ /dev/null
@@ -1,103 +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_no_registry",
-  launch_path: "/chrome/toolkit/webapps/tests/app.sjs?appreq",
-};
-
-let app = {
-  name: "test_desktop_hosted_launch_no_registry",
-  manifestURL: "http://127.0.0.1:8888/sample_no_registry.manifest",
-  manifest: manifest,
-  origin: "http://127.0.0.1:8888/",
-  categories: [],
-  installOrigin: "http://127.0.0.1:8888/",
-  receipts: [],
-  installTime: Date.now(),
-};
-
-let testAppInfo = new TestAppInfo(app);
-
-let runTest = Task.async(function*() {
-  // Get to a clean state before the test
-  yield testAppInfo.cleanup();
-
-  SimpleTest.registerCleanupFunction(() => testAppInfo.cleanup());
-
-  setDryRunPref();
-
-  let nativeApp = new NativeApp(app, manifest, app.categories);
-  ok(nativeApp, "NativeApp object created");
-
-  testAppInfo.profileDir = nativeApp.createProfile();
-  ok(testAppInfo.profileDir && testAppInfo.profileDir.exists(), "Profile directory created");
-
-  // On Mac build servers, we don't have enough privileges to write to /Applications,
-  // so we install apps in a user-owned directory.
-  if (MAC) {
-    yield setMacRootInstallDir(OS.Path.join(OS.Constants.Path.homeDir, "Applications"));
-  }
-
-  // Install application
-  info("Test installation");
-  yield nativeApp.install(app, manifest);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-
-  let exeFile = getFile(testAppInfo.exePath);
-
-  ok(exeFile.isExecutable(), "webapprt executable is executable");
-
-  let appClosed = false;
-
-  testAppInfo.appProcess.init(exeFile)
-  testAppInfo.appProcess.runAsync([], 0, () => appClosed = true);
-
-  while (!(yield wasAppSJSAccessed()) && !appClosed) {
-    yield wait(1000);
-  }
-  ok(!appClosed, "App was launched and is still running");
-
-  SimpleTest.finish();
-});
-
-prepareEnv(() => runTest().catch((e) => {
-  ok(false, "Error during test: " + e);
-  SimpleTest.finish();
-}));
-
-]]>
-</script>
-</window>
deleted file mode 100644
--- a/toolkit/webapps/tests/test_hosted_uninstall.xul
+++ /dev/null
@@ -1,145 +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=898647
--->
-<window title="Mozilla Bug 898647"
-        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=898647"
-     target="_blank">Mozilla Bug 898647</a>
-  </body>
-
-<script type="application/javascript">
-<![CDATA[
-
-/** Test for Bug 898647 **/
-
-"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");
-
-let manifest = {
-  name: "Sample hosted app",
-};
-
-let app = {
-  name: "Sample hosted app",
-  manifestURL: "http://example.com/sample.manifest",
-  manifest: manifest,
-  origin: "http://example.com/",
-  categories: [],
-  installOrigin: "http://example.com/",
-  receipts: [],
-  installTime: Date.now(),
-};
-
-let testAppInfo = new TestAppInfo(app);
-
-let runTest = Task.async(function*() {
-  // Get to a clean state before the test
-  yield testAppInfo.cleanup();
-
-  SimpleTest.registerCleanupFunction(() => testAppInfo.cleanup());
-
-  setDryRunPref();
-
-  let nativeApp = new NativeApp(app, manifest, app.categories);
-  ok(nativeApp, "NativeApp object created");
-
-  testAppInfo.profileDir = nativeApp.createProfile();
-  ok(testAppInfo.profileDir && testAppInfo.profileDir.exists(), "Profile directory created");
-  ok((yield OS.File.exists(testAppInfo.profilesIni)), "profiles.ini file created");
-
-  // On Mac build servers, we don't have enough privileges to write to /Applications,
-  // so we install apps in a user-owned directory.
-  if (MAC) {
-    yield setMacRootInstallDir(OS.Path.join(OS.Constants.Path.homeDir, "Applications"));
-  }
-
-  // Install application
-  info("Test installation");
-  yield nativeApp.install(app, manifest);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-  ok((yield checkFiles(testAppInfo.installedFiles)), "Files correctly written");
-  is(WebappOSUtils.getInstallPath(app), testAppInfo.installPath, "getInstallPath == installPath");
-
-  // Uninstall application
-  info("Test uninstallation");
-  ok((yield WebappOSUtils.uninstall(app)), "Application uninstalled");
-
-  ok(testAppInfo.profileDir.exists(), "Profile directory still existent");
-
-  if (LINUX) {
-    ok((yield dirContainsOnly(testAppInfo.installPath,
-                              [
-                                testAppInfo.profileDir.path,
-                                testAppInfo.profilesIni
-                              ])),
-       "Files correctly removed");
-  } else if (WIN) {
-    ok((yield dirContainsOnly(testAppInfo.installPath, 
-                              [
-                                testAppInfo.profileDir.parent.path,
-                                testAppInfo.profilesIni,
-                                OS.Path.join(testAppInfo.installPath, "uninstall")
-                              ])),
-       "Files correctly removed");
-  } else if (MAC) {
-    ok(!(yield OS.File.exists(testAppInfo.installPath)), "Files correctly removed");
-  }
-  // On Mac, the app is moved to the trash, it is still considered launchable
-  // (because it does have a install path).
-  if (!MAC) {
-    ok(!WebappOSUtils.isLaunchable(app), "App not launchable");
-    is(WebappOSUtils.getInstallPath(app), null, "getInstallPath == null");
-  } else {
-    testAppInfo.trashDir = WebappOSUtils.getInstallPath(app);
-    ok(testAppInfo.trashDir.includes(".Trash"), "App moved to Trash");
-  }
-
-  is(WebappOSUtils.launch(app), false, "Launch fails");
-
-  // On Mac, after we've tried to launch the app, its install path becomes null
-  // We can now repeat the tests we've already done on the other platforms:
-  if (MAC) {
-    while (WebappOSUtils.isLaunchable(app)) {
-      yield wait(1000);
-    }
-    ok(true, "App not launchable");
-
-    is(WebappOSUtils.getInstallPath(app), null, "getInstallPath == null");
-  }
-
-  let exc;
-  try {
-    yield WebappOSUtils.uninstall(app);
-  } catch (e) {
-    exc = e;
-  }
-  ok(!!exc, "Re-uninstalling failed");
-
-  SimpleTest.finish();
-});
-
-prepareEnv(() => runTest().catch((e) => {
-  ok(false, "Error during test: " + e);
-  SimpleTest.finish();
-}));
-
-]]>
-</script>
-</window>
deleted file mode 100644
--- a/toolkit/webapps/tests/test_hosted_update_from_webapp_runtime.xul
+++ /dev/null
@@ -1,120 +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/",
-};
-
-let updatedManifest = {
-  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 testAppInfo = new TestAppInfo(app);
-
-let runTest = Task.async(function*() {
-  // Get to a clean state before the test
-  yield testAppInfo.cleanup();
-
-  SimpleTest.registerCleanupFunction(() => testAppInfo.cleanup());
-
-  setDryRunPref();
-
-  let nativeApp = new NativeApp(app, manifest, app.categories);
-  ok(nativeApp, "NativeApp object created");
-
-  testAppInfo.profileDir = nativeApp.createProfile();
-  ok(testAppInfo.profileDir && testAppInfo.profileDir.exists(), "Profile directory created");
-
-  // On Mac build servers, we don't have enough privileges to write to /Applications,
-  // so we install apps in a user-owned directory.
-  if (MAC) {
-    yield setMacRootInstallDir(OS.Path.join(OS.Constants.Path.homeDir, "Applications"));
-  }
-
-  // Install application
-  info("Test installation");
-  yield nativeApp.install(app, manifest);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-
-  // Prepare update
-  info("Test update");
-  yield nativeApp.prepareUpdate(app, updatedManifest);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-
-  // Let the webapp runtime apply the update. The app.sjs?appreq page is
-  // accessed only if the app is actually updated (because the old manifest
-  // contained a different launch path).
-
-  let exeFile = getFile(testAppInfo.exePath);
-
-  ok(exeFile.isExecutable(), "webapprt executable is executable");
-
-  let appClosed = false;
-
-  testAppInfo.appProcess.init(exeFile)
-  testAppInfo.appProcess.runAsync([], 0, () => appClosed = true);
-
-  while (!(yield wasAppSJSAccessed()) && !appClosed) {
-    yield wait(1000);
-  }
-  ok(!appClosed, "App was launched and is still running");
-
-  SimpleTest.finish();
-});
-
-prepareEnv(() => runTest().catch((e) => {
-  ok(false, "Error during test: " + e);
-  SimpleTest.finish();
-}));
-
-]]>
-</script>
-</window>
deleted file mode 100644
--- a/toolkit/webapps/tests/test_install_appcache.xul
+++ /dev/null
@@ -1,126 +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=1034730
--->
-<window title="Mozilla Bug 1034730"
-        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=1034730"
-     target="_blank">Mozilla Bug 1034730</a>
-  </body>
-
-<script type="application/javascript">
-<![CDATA[
-
-/** Test for Bug 1034730 **/
-
-"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 runTest = Task.async(function*() {
-  let manifest = yield readJSON(getTestFilePath("data/appcached_app/manifest.webapp"));
-
-  let app = {
-    name: manifest.name,
-    manifestURL: "http://127.0.0.1:8888/chrome/toolkit/webapps/tests/data/appcached_app/manifest.webapp",
-    origin: "http://127.0.0.1:8888/",
-  };
-
-  let testAppInfo = new TestAppInfo(app, false);
-
-  // Get to a clean state before the test
-  yield testAppInfo.cleanup();
-
-  SimpleTest.registerCleanupFunction(() => testAppInfo.cleanup());
-
-  setDryRunPref();
-
-  // On Mac build servers, we don't have enough privileges to write to /Applications,
-  // so we install apps in a user-owned directory.
-  if (MAC) {
-    yield setMacRootInstallDir(OS.Path.join(OS.Constants.Path.homeDir, "Applications"));
-  }
-
-  confirmNextPopup();
-
-  let request = navigator.mozApps.install(app.manifestURL);
-
-  {
-    let deferred = Promise.defer();
-    request.onerror = function() {
-      deferred.reject(this.error.name);
-    };
-    request.onsuccess = deferred.resolve;
-    yield deferred.promise;
-  }
-
-  let appObject = request.result;
-  ok(appObject, "app is non-null");
-
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-
-  {
-    let size = 0;
-    do {
-      try {
-        size = yield dirSize(OS.Path.join(testAppInfo.profileDir.path, "OfflineCache"));
-      } catch (e) {
-        yield wait(1000);
-      }
-    } while (size == 0);
-    ok(size > 100000, "There are some files in the OfflineCache directory");
-  }
-
-  let exeFile = getFile(testAppInfo.exePath);
-
-  let appClosed = false;
-
-  testAppInfo.appProcess.init(exeFile)
-  testAppInfo.appProcess.runAsync([], 0, () => appClosed = true);
-
-  while (!(yield wasAppSJSAccessed()) && !appClosed) {
-    yield wait(1000);
-  }
-  ok(!appClosed, "App was launched and is still running");
-
-  {
-    let size = 0;
-    do {
-      try {
-        size = yield dirSize(OS.Path.join(testAppInfo.cacheDir.path, "OfflineCache"));
-      } catch (e) {
-        yield wait(1000);
-      }
-    } while (size == 0);
-    ok(size > 100000, "There are some files in the OfflineCache directory");
-  }
-
-  SimpleTest.finish();
-});
-
-prepareEnv(() => runTest().catch((e) => {
-  ok(false, "Error during test: " + e);
-  SimpleTest.finish();
-}));
-
-]]>
-</script>
-</window>
deleted file mode 100644
--- a/toolkit/webapps/tests/test_non_ascii_app_name.xul
+++ /dev/null
@@ -1,158 +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=1152552
--->
-<window title="Mozilla Bug 1152552"
-        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=898647"
-     target="_blank">Mozilla Bug 898647</a>
-  </body>
-
-<script type="application/javascript">
-<![CDATA[
-
-/** Test for Bug 1152552 **/
-
-"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");
-
-let manifest = {
-  // Test unicode app names, the hyphen being \u2013
-  name: "Sample hosted app – \u2603 \u26a0",
-};
-
-let app = {
-  name: "Sample hosted app – \u2603 \u26a0",
-  manifestURL: "http://example.com/sample.manifest",
-  manifest: manifest,
-  origin: "http://example.com/",
-  categories: [],
-  installOrigin: "http://example.com/",
-  receipts: [],
-  installTime: Date.now(),
-};
-
-let testAppInfo = new TestAppInfo(app);
-
-let runTest = Task.async(function*() {
-  // Get to a clean state before the test
-  yield testAppInfo.cleanup();
-
-  SimpleTest.registerCleanupFunction(() => testAppInfo.cleanup());
-
-  setDryRunPref();
-
-  let nativeApp = new NativeApp(app, manifest, app.categories);
-  ok(nativeApp, "NativeApp object created");
-
-  info("Test update for an uninstalled application");
-  try {
-    yield nativeApp.prepareUpdate(app, manifest);
-    ok(false, "Didn't thrown");
-  } catch (ex) {
-    is(ex, "The application isn't installed", "Exception thrown");
-  }
-
-  testAppInfo.profileDir = nativeApp.createProfile();
-  ok(testAppInfo.profileDir && testAppInfo.profileDir.exists(), "Profile directory created");
-  ok((yield OS.File.exists(testAppInfo.profilesIni)), "profiles.ini file created");
-
-  // On Mac build servers, we don't have enough privileges to write to /Applications,
-  // so we install apps in a user-owned directory.
-  if (MAC) {
-    yield setMacRootInstallDir(OS.Path.join(OS.Constants.Path.homeDir, "Applications"));
-  }
-
-  // Install application
-  info("Test installation");
-  yield nativeApp.install(app, manifest);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-  ok((yield checkFiles(testAppInfo.installedFiles)), "Files correctly written");
-  is(WebappOSUtils.getInstallPath(app), testAppInfo.installPath, "getInstallPath == installPath");
-
-  let stat = yield OS.File.stat(testAppInfo.installPath);
-  let installTime = stat.lastModificationDate;
-
-  // Wait one second, otherwise the last modification date is the same.
-  yield wait(1000);
-
-  // Reinstall application
-  info("Test reinstallation");
-  yield nativeApp.install(app, manifest);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-  ok((yield checkFiles(testAppInfo.installedFiles)), "Installation not corrupted");
-  ok((yield checkFiles(testAppInfo.tempUpdatedFiles)), "Files correctly written in the update subdirectory");
-
-  yield nativeApp.applyUpdate(app);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-
-  if (MAC) {
-    stat = yield OS.File.stat(testAppInfo.webappINI);
-    is(stat.unixMode, 0o644, "Configuration file permissions correct");
-  } else if (LINUX) {
-    stat = yield OS.File.stat(testAppInfo.desktopINI);
-    is(stat.unixMode, 0o744, "Configuration file permissions correct");
-  }
-
-  ok((yield checkFiles(testAppInfo.installedFiles)), "Installation not corrupted");
-  ok(!(yield OS.File.exists(OS.Path.join(testAppInfo.installPath, "update"))), "Update directory removed");
-  ok((yield checkDateHigherThan(testAppInfo.updatedFiles, installTime)), "Modification date higher");
-
-  stat = yield OS.File.stat(testAppInfo.installPath);
-  installTime = stat.lastModificationDate;
-
-  // Wait one second, otherwise the last modification date is the same.
-  yield wait(1000);
-
-  // Update application
-  info("Test update");
-  yield nativeApp.prepareUpdate(app, manifest);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-  ok((yield checkFiles(testAppInfo.installedFiles)), "Installation not corrupted");
-  ok((yield checkFiles(testAppInfo.tempUpdatedFiles)), "Files correctly written in the update subdirectory");
-
-  yield nativeApp.applyUpdate(app);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-  ok((yield checkFiles(testAppInfo.installedFiles)), "Installation not corrupted");
-  ok(!(yield OS.File.exists(OS.Path.join(testAppInfo.installPath, "update"))), "Update directory removed");
-  ok((yield checkDateHigherThan(testAppInfo.updatedFiles, installTime)), "Modification date higher");
-
-  SimpleTest.finish();
-});
-
-prepareEnv(() => runTest().catch((e) => {
-  ok(false, "Error during test: " + e);
-  SimpleTest.finish();
-}));
-
-]]>
-</script>
-</window>
deleted file mode 100644
--- a/toolkit/webapps/tests/test_packaged.xul
+++ /dev/null
@@ -1,174 +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=898647
--->
-<window title="Mozilla Bug 898647"
-        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=898647"
-     target="_blank">Mozilla Bug 898647</a>
-  </body>
-
-<script type="application/javascript">
-<![CDATA[
-
-/** Test for Bug 898647 **/
-
-"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");
-
-let zipPath = OS.Path.join(OS.Constants.Path.profileDir, "sample.zip");
-
-let manifest = {
-  name: "Sample packaged app",
-  version: "0.1a",
-  size: 777,
-  package_path: "/sample.zip",
-};
-
-let app = {
-  name: "Sample packaged app",
-  manifestURL: "http://example.com/sample.manifest",
-  manifest: manifest,
-  updateManifest: manifest,
-  origin: "http://example.com/",
-  categories: [],
-  installOrigin: "http://example.com/",
-  receipts: [],
-  installTime: Date.now(),
-};
-
-let testAppInfo = new TestAppInfo(app, true);
-
-let runTest = Task.async(function*() {
-  // Get to a clean state before the test
-  yield testAppInfo.cleanup();
-
-  SimpleTest.registerCleanupFunction(() => testAppInfo.cleanup());
-
-  setDryRunPref();
-
-  let zipFile = yield OS.File.open(zipPath, { create: true });
-  yield zipFile.close();
-
-  let nativeApp = new NativeApp(app, manifest, app.categories);
-  ok(nativeApp, "NativeApp object created");
-
-  info("Test update for an application that isn't installed");
-  try {
-    yield nativeApp.prepareUpdate(app, manifest, zipPath);
-    ok(false, "Didn't thrown");
-  } catch (ex) {
-    is(ex, "The application isn't installed", "Exception thrown");
-  }
-
-  testAppInfo.profileDir = nativeApp.createProfile();
-  ok(testAppInfo.profileDir && testAppInfo.profileDir.exists(), "Profile directory created");
-  ok((yield OS.File.exists(testAppInfo.profilesIni)), "profiles.ini file created");
-
-  // On Mac build servers, we don't have enough privileges to write to /Applications,
-  // so we install apps in a user-owned directory.
-  if (MAC) {
-    yield setMacRootInstallDir(OS.Path.join(OS.Constants.Path.homeDir, "Applications"));
-  }
-
-  // Install application
-  info("Test installation");
-  yield nativeApp.install(app, manifest, zipPath);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-  ok((yield checkFiles(testAppInfo.installedFiles)), "Files correctly written");
-  is(WebappOSUtils.getInstallPath(app), testAppInfo.installPath, "getInstallPath == installPath");
-
-  let stat = yield OS.File.stat(testAppInfo.installPath);
-  let installTime = stat.lastModificationDate;
-
-  // Wait one second, otherwise the last modification date is the same.
-  yield wait(1000);
-
-  // Reinstall application
-  info("Test reinstallation");
-
-  zipFile = yield OS.File.open(zipPath, { create: true });
-  yield zipFile.close();
-
-  yield nativeApp.install(app, manifest, zipPath);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-  ok((yield checkFiles(testAppInfo.installedFiles)), "Installation not corrupted");
-  ok((yield checkFiles(testAppInfo.tempUpdatedFiles)), "Files correctly written in the update subdirectory");
-
-  yield nativeApp.applyUpdate(app);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-
-  if (MAC) {
-    stat = yield OS.File.stat(testAppInfo.webappINI);
-    is(stat.unixMode, 0o644, "Configuration file permissions correct");
-  } else if (LINUX) {
-    stat = yield OS.File.stat(testAppInfo.desktopINI);
-    is(stat.unixMode, 0o744, "Configuration file permissions correct");
-  }
-
-  ok((yield checkFiles(testAppInfo.installedFiles)), "Installation not corrupted");
-  ok(!(yield OS.File.exists(OS.Path.join(testAppInfo.installPath, "update"))), "Update directory removed");
-  ok((yield checkDateHigherThan(testAppInfo.updatedFiles, installTime)), "Modification date higher");
-
-  stat = yield OS.File.stat(testAppInfo.installPath);
-  installTime = stat.lastModificationDate;
-
-  // Wait one second, otherwise the last modification date is the same.
-  yield wait(1000);
-
-  // Update application
-  info("Test update");
-
-  zipFile = yield OS.File.open(zipPath, { create: true });
-  yield zipFile.close();
-
-  yield nativeApp.prepareUpdate(app, manifest, zipPath);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-  ok((yield checkFiles(testAppInfo.installedFiles)), "Installation not corrupted");
-  ok((yield checkFiles(testAppInfo.tempUpdatedFiles)), "Files correctly written in the update subdirectory");
-
-  yield nativeApp.applyUpdate(app);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-  ok((yield checkFiles(testAppInfo.installedFiles)), "Installation not corrupted");
-  ok(!(yield OS.File.exists(OS.Path.join(testAppInfo.installPath, "update"))), "Update directory removed");
-  ok((yield checkDateHigherThan(testAppInfo.updatedFiles, installTime)), "Modification date higher");
-
-  SimpleTest.finish();
-});
-
-prepareEnv(() => runTest().catch((e) => {
-  ok(false, "Error during test: " + e);
-  SimpleTest.finish();
-}));
-
-]]>
-</script>
-</window>
deleted file mode 100644
--- a/toolkit/webapps/tests/test_packaged_checkforupdates_from_webapp_runtime.xul
+++ /dev/null
@@ -1,128 +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=1036717
--->
-<window title="Mozilla Bug 1036717"
-        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=1036717"
-     target="_blank">Mozilla Bug 1036717</a>
-  </body>
-
-<script type="application/javascript">
-<![CDATA[
-
-/** Test for Bug 1036717 **/
-
-"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 runTest = Task.async(function*() {
-  let manifest = yield readJSON(getTestFilePath("data/app/manifest.webapp"));
-
-  let app = {
-    name: manifest.name,
-    manifestURL: "http://127.0.0.1:8888/chrome/toolkit/webapps/tests/app.sjs?getManifest=true",
-    origin: "app://test.app",
-  };
-
-  let testAppInfo = new TestAppInfo(app, true);
-
-  // Get to a clean state before the test
-  yield testAppInfo.cleanup();
-
-  SimpleTest.registerCleanupFunction(() => testAppInfo.cleanup());
-
-  setDryRunPref();
-
-  // On Mac build servers, we don't have enough privileges to write to /Applications,
-  // so we install apps in a user-owned directory.
-  if (MAC) {
-    yield setMacRootInstallDir(OS.Path.join(OS.Constants.Path.homeDir, "Applications"));
-  }
-
-  confirmNextPopup();
-
-  yield setState("Version", 1);
-
-  let request = navigator.mozApps.installPackage(app.manifestURL);
-
-  {
-    let deferred = Promise.defer();
-    request.onerror = function() {
-      deferred.reject(this.error.name);
-    };
-    request.onsuccess = deferred.resolve;
-    yield deferred.promise;
-  }
-
-  let appObject = request.result;
-  ok(appObject, "app is non-null");
-
-  {
-    let deferred = Promise.defer();
-    appObject.ondownloaderror = function() {
-      deferred.reject(appObject.downloadError.name);
-    };
-    appObject.ondownloadapplied = deferred.resolve;
-    yield deferred.promise;
-  }
-
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-
-  // Force the update timer to fire in 1 second
-  let prefsFile = OS.Path.join(testAppInfo.profileDir.path, "prefs.js");
-  yield writeToFile(prefsFile, "user_pref(\"webapprt.app_update_interval\", 1);");
-
-  // Update app version
-  yield setState("Version", 2);
-
-  // Launch the webapprt executable that will verify the presence of an update
-  let exeFile = getFile(testAppInfo.exePath);
-
-  let appClosed = false;
-
-  testAppInfo.appProcess.init(exeFile)
-  testAppInfo.appProcess.runAsync([], 0, () => appClosed = true);
-
-  // If there was a second request to get the manifest and the package,
-  // then the webapprt has searched for an update and has started to
-  // download it.
-  while ((Number(yield getState("PackageQueries")) < 2 ||
-          Number(yield getState("ManifestQueries")) < 2) &&
-         !appClosed) {
-    yield wait(1000);
-  }
-  ok(!appClosed, "App was launched and is still running");
-  ok(Number(yield getState("ManifestQueries")) >= 2, "Two manifest requests");
-  ok(Number(yield getState("PackageQueries")) >= 2, "Two package requests");
-
-  SimpleTest.finish();
-});
-
-prepareEnv(() => runTest().catch((e) => {
-  ok(false, "Error during test: " + e);
-  SimpleTest.finish();
-}));
-
-]]>
-</script>
-</window>
deleted file mode 100644
--- a/toolkit/webapps/tests/test_packaged_icons.xul
+++ /dev/null
@@ -1,170 +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=898647
--->
-<window title="Mozilla Bug 898647"
-        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=898647"
-     target="_blank">Mozilla Bug 898647</a>
-  </body>
-
-<script type="application/javascript">
-<![CDATA[
-
-/** Test for Bug 898647 **/
-
-"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");
-
-let zipPath = OS.Path.join(OS.Constants.Path.profileDir, "sample.zip");
-
-let manifest = {
-  name: "Sample packaged app",
-  version: "0.1a",
-  size: 777,
-  package_path: "/sample.zip",
-};
-
-let app = {
-  name: "Sample packaged app",
-  manifestURL: "http://example.com/sample.manifest",
-  manifest: manifest,
-  updateManifest: manifest,
-  origin: "app://test_desktop_packaged_launch/",
-  categories: [],
-  installOrigin: "http://example.com/",
-  receipts: [],
-  installTime: Date.now(),
-};
-
-let testIconFile = getFile(getTestFilePath("data/icon.png"));
-
-let iconTests = [
-  // No icon specified
-  {},
-  // Absolute URI
-  {"32": "http://example.com/chrome/toolkit/webapps/tests/data/icon.png"},
-  // Relative URI
-  {"32": "/icon.png"},
-  // Data URI icon
-  {"32": generateDataURI(testIconFile) },
-  // URI to a file that isn't an image
-  {"32": "/index.html"},
-  // Large icon that won't be used on Windows (bug #1152597)
-  {"512": "http://example.com/chrome/toolkit/webapps/tests/data/512.png"},
-];
-
-// This is an array of the icon sizes associated with the elements of
-// iconTests. Each element in the iconSizes array is an array of two values:
-//  - The expected size of the icon
-//  - An epsilon value that defines an accepted range around the icon size.
-// On each platform the size is different (because the format of the file is
-// different: ICO on Windows, PNG on Linux, ICNS on Mac).
-// The epsilon value is 0 on Windows and Linux, where the size of the file
-// is precise (because we convert the icons with our own code). It is ~0 on
-// Mac because we use SIPS to convert the icon, and its output isn't
-// the same across Mac versions.
-
-let iconSizes;
-
-if (LINUX) {
-  iconSizes = [
-    [4009, 0],
-    [2787, 0],
-    [2787, 0],
-    [2787, 0],
-    [4009, 0],
-    [2195, 0],
-  ];
-} else if (WIN) {
-  iconSizes = [
-    [16958, 0],
-    [4286, 0],
-    [4286, 0],
-    [4286, 0],
-    [16958, 0],
-    // Windows ICO doesn't support 512x512 icons. The default should be chosen.
-    [16958, 0],
-  ];
-} else if (MAC) {
-  iconSizes = [
-    [14000, 2000],
-    [27000, 2000],
-    [27000, 2000],
-    [27000, 2000],
-    [14000, 2000],
-    [1000, 2000],
-  ];
-}
-
-let testAppInfo = new TestAppInfo(app, true);
-
-let runTest = Task.async(function*() {
-  SimpleTest.registerCleanupFunction(() => testAppInfo.cleanup());
-
-  setDryRunPref();
-
-  for (let curTest = 0; curTest < iconTests.length; curTest++) {
-    // Get to a clean state before the test
-    yield testAppInfo.cleanup();
-
-    manifest.icons = iconTests[curTest];
-    info("Test icon: " + JSON.stringify(manifest.icons));
-
-    let zipPath = buildAppPackage(manifest, testIconFile);
-
-    let nativeApp = new NativeApp(app, manifest, app.categories);
-    ok(nativeApp, "NativeApp object created");
-
-    testAppInfo.profileDir = nativeApp.createProfile();
-    ok(testAppInfo.profileDir && testAppInfo.profileDir.exists(), "Profile directory created");
-    ok((yield OS.File.exists(testAppInfo.profilesIni)), "profiles.ini file created");
-
-    // On Mac build servers, we don't have enough privileges to write to /Applications,
-    // so we install apps in a user-owned directory.
-    if (MAC) {
-    yield setMacRootInstallDir(OS.Path.join(OS.Constants.Path.homeDir, "Applications"));
-    }
-
-    // Install application
-    info("Test installation");
-    yield nativeApp.install(app, manifest, zipPath);
-    while (!WebappOSUtils.isLaunchable(app)) {
-      yield wait(1000);
-    }
-    ok(true, "App launchable");
-
-    let stat = yield OS.File.stat(testAppInfo.iconFile);
-    isfuzzy(stat.size, iconSizes[curTest][0], iconSizes[curTest][1],
-            "Icon size correct");
-
-    // Flush the ZipReaderCache (so that the application.zip file gets closed)
-    Services.obs.notifyObservers(null, "chrome-flush-caches", null);
-  }
-
-  SimpleTest.finish();
-});
-
-prepareEnv(() => runTest().catch((e) => {
-  ok(false, "Error during test: " + e);
-  SimpleTest.finish();
-}));
-
-]]>
-</script>
-</window>
deleted file mode 100644
--- a/toolkit/webapps/tests/test_packaged_launch.xul
+++ /dev/null
@@ -1,111 +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");
-
-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 testAppInfo = new TestAppInfo(app, true);
-
-let runTest = Task.async(function*() {
-  // Get to a clean state before the test
-  yield testAppInfo.cleanup();
-
-  SimpleTest.registerCleanupFunction(() => testAppInfo.cleanup());
-
-  setDryRunPref();
-
-  let zipPath = buildAppPackage(manifest);
-
-  let nativeApp = new NativeApp(app, manifest, app.categories);
-  ok(nativeApp, "NativeApp object created");
-
-  testAppInfo.profileDir = nativeApp.createProfile();
-  ok(testAppInfo.profileDir && testAppInfo.profileDir.exists(), "Profile directory created");
-
-  // On Mac build servers, we don't have enough privileges to write to /Applications,
-  // so we install apps in a user-owned directory.
-  if (MAC) {
-    yield setMacRootInstallDir(OS.Path.join(OS.Constants.Path.homeDir, "Applications"));
-  }
-
-  // Install application
-  info("Test installation");
-  yield nativeApp.install(app, manifest, zipPath);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-
-  let exeFile = getFile(testAppInfo.exePath);
-
-  ok(exeFile.isExecutable(), "webapprt executable is executable");
-
-  let appClosed = false;
-
-  testAppInfo.appProcess.init(exeFile)
-  testAppInfo.appProcess.runAsync([], 0, () => appClosed = true);
-
-  while (!(yield wasAppSJSAccessed()) && !appClosed) {
-    yield wait(1000);
-  }
-  ok(!appClosed, "App was launched and is still running");
-
-  SimpleTest.finish();
-});
-
-prepareEnv(() => runTest().catch((e) => {
-  ok(false, "Error during test: " + e);
-  SimpleTest.finish();
-}));
-
-]]>
-</script>
-</window>
deleted file mode 100644
--- a/toolkit/webapps/tests/test_packaged_launch_no_registry.xul
+++ /dev/null
@@ -1,111 +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");
-
-let manifest = {
-  name: "test_desktop_packaged_launch_no_registry",
-  version: "0.1a",
-  size: 777,
-  package_path: "/data/app.zip",
-  launch_path: "/index.html",
-};
-
-let app = {
-  name: "test_desktop_packaged_launch_no_registry",
-  manifestURL: "http://127.0.0.1:8888/sample_no_registry.manifest",
-  manifest: manifest,
-  updateManifest: manifest,
-  origin: "app://test_desktop_packaged_launch_no_registry/",
-  categories: [],
-  installOrigin: "http://127.0.0.1:8888/",
-  receipts: [],
-  installTime: Date.now(),
-};
-
-let testAppInfo = new TestAppInfo(app, true);
-
-let runTest = Task.async(function*() {
-  // Get to a clean state before the test
-  yield testAppInfo.cleanup();
-
-  SimpleTest.registerCleanupFunction(() => testAppInfo.cleanup());
-
-  setDryRunPref();
-
-  let zipPath = buildAppPackage(manifest);
-
-  let nativeApp = new NativeApp(app, manifest, app.categories);
-  ok(nativeApp, "NativeApp object created");
-
-  testAppInfo.profileDir = nativeApp.createProfile();
-  ok(testAppInfo.profileDir && testAppInfo.profileDir.exists(), "Profile directory created");
-
-  // On Mac build servers, we don't have enough privileges to write to /Applications,
-  // so we install apps in a user-owned directory.
-  if (MAC) {
-    yield setMacRootInstallDir(OS.Path.join(OS.Constants.Path.homeDir, "Applications"));
-  }
-
-  // Install application
-  info("Test installation");
-  yield nativeApp.install(app, manifest, zipPath);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-
-  let exeFile = getFile(testAppInfo.exePath);
-
-  ok(exeFile.isExecutable(), "webapprt executable is executable");
-
-  let appClosed = false;
-
-  testAppInfo.appProcess.init(exeFile)
-  testAppInfo.appProcess.runAsync([], 0, () => appClosed = true);
-
-  while (!(yield wasAppSJSAccessed()) && !appClosed) {
-    yield wait(1000);
-  }
-  ok(!appClosed, "App was launched and is still running");
-
-  SimpleTest.finish();
-});
-
-prepareEnv(() => runTest().catch((e) => {
-  ok(false, "Error during test: " + e);
-  SimpleTest.finish();
-}));
-
-]]>
-</script>
-</window>
deleted file mode 100644
--- a/toolkit/webapps/tests/test_packaged_uninstall.xul
+++ /dev/null
@@ -1,154 +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=898647
--->
-<window title="Mozilla Bug 898647"
-        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=898647"
-     target="_blank">Mozilla Bug 898647</a>
-  </body>
-
-<script type="application/javascript">
-<![CDATA[
-
-/** Test for Bug 898647 **/
-
-"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");
-
-let zipPath = OS.Path.join(OS.Constants.Path.profileDir, "sample.zip");
-
-let manifest = {
-  name: "Sample packaged app",
-  version: "0.1a",
-  size: 777,
-  package_path: "/sample.zip",
-};
-
-let app = {
-  name: "Sample packaged app",
-  manifestURL: "http://example.com/sample.manifest",
-  manifest: manifest,
-  updateManifest: manifest,
-  origin: "http://example.com/",
-  categories: [],
-  installOrigin: "http://example.com/",
-  receipts: [],
-  installTime: Date.now(),
-};
-
-let testAppInfo = new TestAppInfo(app, true);
-
-let runTest = Task.async(function*() {
-  // Get to a clean state before the test
-  yield testAppInfo.cleanup();
-
-  SimpleTest.registerCleanupFunction(() => testAppInfo.cleanup());
-
-  setDryRunPref();
-
-  let zipFile = yield OS.File.open(zipPath, { create: true });
-  yield zipFile.close();
-
-  let nativeApp = new NativeApp(app, manifest, app.categories);
-  ok(nativeApp, "NativeApp object created");
-
-  testAppInfo.profileDir = nativeApp.createProfile();
-  ok(testAppInfo.profileDir && testAppInfo.profileDir.exists(), "Profile directory created");
-  ok((yield OS.File.exists(testAppInfo.profilesIni)), "profiles.ini file created");
-
-  // On Mac build servers, we don't have enough privileges to write to /Applications,
-  // so we install apps in a user-owned directory.
-  if (MAC) {
-    yield setMacRootInstallDir(OS.Path.join(OS.Constants.Path.homeDir, "Applications"));
-  }
-
-  // Install application
-  info("Test installation");
-  yield nativeApp.install(app, manifest, zipPath);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-  ok((yield checkFiles(testAppInfo.installedFiles)), "Files correctly written");
-  is(WebappOSUtils.getInstallPath(app), testAppInfo.installPath, "getInstallPath == installPath");
-
-  // Uninstall application
-  info("Test uninstallation");
-  ok((yield WebappOSUtils.uninstall(app)), "Application uninstalled");
-
-  ok(testAppInfo.profileDir.exists(), "Profile directory still existent");
-
-  if (LINUX) {
-    ok((yield dirContainsOnly(testAppInfo.installPath,
-                              [
-                                testAppInfo.profileDir.path,
-                                testAppInfo.profilesIni
-                              ])),
-       "Files correctly removed");
-  } else if (WIN) {
-    ok((yield dirContainsOnly(testAppInfo.installPath, 
-                              [
-                                testAppInfo.profileDir.parent.path,
-                                testAppInfo.profilesIni,
-                                OS.Path.join(testAppInfo.installPath, "uninstall")
-                              ])),
-       "Files correctly removed");
-  } else if (MAC) {
-    ok(!(yield OS.File.exists(testAppInfo.installPath)), "Files correctly removed");
-  }
-
-  // On Mac, the app is moved to the trash, it is still considered launchable
-  // (because it does have a install path).
-  if (!MAC) {
-    ok(!WebappOSUtils.isLaunchable(app), "App not launchable");
-    is(WebappOSUtils.getInstallPath(app), null, "getInstallPath == null");
-  } else {
-    testAppInfo.trashDir = WebappOSUtils.getInstallPath(app);
-    ok(testAppInfo.trashDir.includes(".Trash"), "App moved to Trash");
-  }
-
-  is(WebappOSUtils.launch(app), false, "Launch fails");
-
-  // On Mac, after we've tried to launch the app, its install path becomes null
-  // We can now repeat the tests we've already done on the other platforms:
-  if (MAC) {
-    while (WebappOSUtils.isLaunchable(app)) {
-      yield wait(1000);
-    }
-    ok(true, "App not launchable");
-
-    is(WebappOSUtils.getInstallPath(app), null, "getInstallPath == null");
-  }
-  let exc;
-  try {
-    yield WebappOSUtils.uninstall(app);
-  } catch (e) {
-    exc = e;
-  }
-  ok(!!exc, "Re-uninstalling failed");
-
-  SimpleTest.finish();
-});
-
-prepareEnv(() => runTest().catch((e) => {
-  ok(false, "Error during test: " + e);
-  SimpleTest.finish();
-}));
-
-]]>
-</script>
-</window>
deleted file mode 100644
--- a/toolkit/webapps/tests/test_packaged_update_from_webapp_runtime.xul
+++ /dev/null
@@ -1,134 +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");
-
-let manifest = {
-  name: "test_desktop_packaged_launch",
-  version: "0.1a",
-  size: 777,
-  package_path: "/data/app.zip",
-  launch_path: "/doesntexist.html",
-};
-
-let updatedManifest = {
-  name: "test_desktop_packaged_launch",
-  version: "0.2a",
-  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 testAppInfo = new TestAppInfo(app, true);
-
-let runTest = Task.async(function*() {
-  // Get to a clean state before the test
-  yield testAppInfo.cleanup();
-
-  SimpleTest.registerCleanupFunction(() => testAppInfo.cleanup());
-
-  setDryRunPref();
-
-  let zipPath = buildAppPackage(manifest);
-
-  let nativeApp = new NativeApp(app, manifest, app.categories);
-  ok(nativeApp, "NativeApp object created");
-
-  testAppInfo.profileDir = nativeApp.createProfile();
-  ok(testAppInfo.profileDir && testAppInfo.profileDir.exists(), "Profile directory created");
-
-  // On Mac build servers, we don't have enough privileges to write to /Applications,
-  // so we install apps in a user-owned directory.
-  if (MAC) {
-    yield setMacRootInstallDir(OS.Path.join(OS.Constants.Path.homeDir, "Applications"));
-  }
-
-  // Install application
-  info("Test installation");
-  yield nativeApp.install(app, manifest, zipPath);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-
-  // Prepare update
-  info("Test update");
-
-  zipPath = buildAppPackage(updatedManifest);
-
-  yield nativeApp.prepareUpdate(app, updatedManifest, zipPath);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-
-  // Let the webapp runtime apply the update. The app.sjs?appreq page is
-  // accessed only if the app is actually updated (because the old manifest
-  // contained a different launch path).
-
-  let exeFile = getFile(testAppInfo.exePath);
-
-  ok(exeFile.isExecutable(), "webapprt executable is executable");
-
-  let appClosed = false;
-
-  testAppInfo.appProcess.init(exeFile)
-  testAppInfo.appProcess.runAsync([], 0, () => appClosed = true);
-
-  while (!(yield wasAppSJSAccessed()) && !appClosed) {
-    yield wait(1000);
-  }
-  ok(!appClosed, "App was launched and is still running");
-
-  SimpleTest.finish();
-});
-
-prepareEnv(() => runTest().catch((e) => {
-  ok(false, "Error during test: " + e);
-  SimpleTest.finish();
-}));
-
-]]>
-</script>
-</window>
deleted file mode 100644
--- a/toolkit/webapps/tests/test_webapp_runtime_executable_update.xul
+++ /dev/null
@@ -1,162 +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=1036751
--->
-<window title="Mozilla Bug 1036751"
-        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=1036751"
-     target="_blank">Mozilla Bug 1036751</a>
-  </body>
-
-<script type="application/javascript">
-<![CDATA[
-
-/** Test for Bug 1036751 **/
-
-"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 testAppInfo = new TestAppInfo(app);
-
-function runProcess() {
-    let deferred = Promise.defer();
-
-    let args = [];
-
-    if (MAC) {
-      // Set the -runtime flag to the test app's install path, which we're using
-      // as the "fake runtime" from which the test app updates its executable.
-      args.push("-runtime", testAppInfo.installPath);
-    }
-
-    testAppInfo.appProcess.runAsync(args, args.length, (aSubject, aTopic) => {
-      if (aTopic == "process-finished") {
-        deferred.resolve(aSubject.exitValue);
-      } else if (aTopic == "process-failed") {
-        deferred.reject(aSubject.exitValue);
-      }
-    });
-
-    return deferred.promise;
-}
-
-let runTest = Task.async(function*() {
-  // Get to a clean state before the test
-  yield testAppInfo.cleanup();
-
-  SimpleTest.registerCleanupFunction(() => testAppInfo.cleanup());
-
-  setDryRunPref();
-
-  let nativeApp = new NativeApp(app, manifest, app.categories);
-  ok(nativeApp, "NativeApp object created");
-
-  testAppInfo.profileDir = nativeApp.createProfile();
-  ok(testAppInfo.profileDir && testAppInfo.profileDir.exists(), "Profile directory created");
-
-  // On Mac build servers, we don't have enough privileges to write to /Applications,
-  // so we install apps in a user-owned directory.
-  if (MAC) {
-    yield setMacRootInstallDir(OS.Path.join(OS.Constants.Path.homeDir, "Applications"));
-  }
-
-  // Install application
-  info("Test installation");
-  yield nativeApp.install(app, manifest);
-  while (!WebappOSUtils.isLaunchable(app)) {
-    yield wait(1000);
-  }
-  ok(true, "App launchable");
-
-  let fakeInstallDir;
-  if (MAC) {
-    fakeInstallDir = getFile(testAppInfo.installPath, "Contents", "Resources");
-  } else {
-    fakeInstallDir = getFile(OS.Constants.Path.profileDir, "fakeInstallDir");
-    fakeInstallDir.createUnique(Ci.nsIFile.DIRECTORY_TYPE, 0o755);
-  }
-
-  let fakeAppIniFile = fakeInstallDir.clone();
-  fakeAppIniFile.append("application.ini");
-
-  let iniFile = getFile(testAppInfo.webappINI);
-
-  let iniWriter = Cc["@mozilla.org/xpcom/ini-processor-factory;1"].
-                  getService(Ci.nsIINIParserFactory).
-                  createINIParser(iniFile).
-                  QueryInterface(Ci.nsIINIParserWriter);
-  iniWriter.setString("WebappRT", "InstallDir", fakeInstallDir.path);
-  iniWriter.writeFile();
-
-  let appIniWriter = Cc["@mozilla.org/xpcom/ini-processor-factory;1"].
-                     getService(Ci.nsIINIParserFactory).
-                     createINIParser(fakeAppIniFile).
-                     QueryInterface(Ci.nsIINIParserWriter);
-  appIniWriter.setString("App", "BuildID", "aBuildID");
-  appIniWriter.writeFile();
-
-  let exeName = "webapprt-stub";
-  if (WIN) {
-    exeName += ".exe";
-  }
-
-  let stubExeName = "TestWebappRT";
-  if (WIN) {
-    stubExeName += ".exe";
-  }
-
-  let exeFile = getFile(testAppInfo.exePath);
-
-  let stubExeFile = getFile(getTestFilePath(stubExeName));
-  stubExeFile.copyTo(fakeInstallDir, exeName);
-
-  testAppInfo.appProcess.init(exeFile);
-
-  if (WIN) {
-    is((yield runProcess()), 0, "Webapp runtime executable has been replaced");
-  }
-  is((yield runProcess()), 42, "Webapp runtime executable has been replaced");
-
-  SimpleTest.finish();
-});
-
-prepareEnv(() => runTest().catch((e) => {
-  ok(false, "Error during test: " + e);
-  SimpleTest.finish();
-}));
-
-]]>
-</script>
-</window>
deleted file mode 100644
--- a/webapprt/CommandLineHandler.js
+++ /dev/null
@@ -1,76 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-const Cu = Components.utils;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-
-function CommandLineHandler() {}
-
-CommandLineHandler.prototype = {
-  classID: Components.ID("{6d69c782-40a3-469b-8bfd-3ee366105a4a}"),
-
-  QueryInterface: XPCOMUtils.generateQI([Ci.nsICommandLineHandler]),
-
-  handle: function handle(cmdLine) {
-    let args = Cc["@mozilla.org/hash-property-bag;1"].
-               createInstance(Ci.nsIWritablePropertyBag);
-    let inTestMode = this._handleTestMode(cmdLine, args);
-
-    if (inTestMode) {
-      // Open the mochitest shim window, which configures the runtime for tests.
-      Services.ww.openWindow(null,
-                             "chrome://webapprt/content/mochitest.xul",
-                             "_blank",
-                             "chrome,dialog=no",
-                             args);
-    } else {
-      // 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);
-      });
-    }
-  },
-
-  _handleTestMode: function _handleTestMode(cmdLine, args) {
-    // -test-mode [url]
-    let idx = cmdLine.findFlag("test-mode", true);
-    if (idx < 0)
-      return false;
-    let url;
-    let urlIdx = idx + 1;
-    if (urlIdx < cmdLine.length) {
-      let potentialURL = cmdLine.getArgument(urlIdx);
-      if (potentialURL && potentialURL[0] != "-") {
-        try {
-          url = Services.io.newURI(potentialURL, null, null);
-        } catch (err) {
-          throw Components.Exception(
-            "-test-mode argument is not a valid URL: " + potentialURL,
-            Components.results.NS_ERROR_INVALID_ARG);
-        }
-        cmdLine.removeArguments(urlIdx, urlIdx);
-        args.setProperty("url", url.spec);
-      }
-    }
-    cmdLine.removeArguments(idx, idx);
-    return true;
-  },
-
-  helpInfo : "",
-};
-
-var components = [CommandLineHandler];
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
deleted file mode 100644
--- a/webapprt/ContentPermission.js
+++ /dev/null
@@ -1,118 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-const Cu = Components.utils;
-
-const UNKNOWN_FAIL = ["geolocation", "desktop-notification"];
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://webapprt/modules/WebappRT.jsm");
-
-function ContentPermission() {}
-
-ContentPermission.prototype = {
-  classID: Components.ID("{07ef5b2e-88fb-47bd-8cec-d3b0bef11ac4}"),
-  QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentPermissionPrompt]),
-
-  _getChromeWindow: function(aWindow) { 
-    return aWindow
-      .QueryInterface(Ci.nsIInterfaceRequestor)
-      .getInterface(Ci.nsIWebNavigation)
-      .QueryInterface(Ci.nsIDocShellTreeItem)
-      .rootTreeItem
-      .QueryInterface(Ci.nsIInterfaceRequestor)
-      .getInterface(Ci.nsIDOMWindow)
-      .QueryInterface(Ci.nsIDOMChromeWindow);
-  },
-
-  prompt: function(request) {
-    // Only allow exactly one permission request here.
-    let types = request.types.QueryInterface(Ci.nsIArray);
-    if (types.length != 1) {
-      request.cancel();
-      return;
-    }
-    let perm = types.queryElementAt(0, Ci.nsIContentPermissionType);
-
-    // Reuse any remembered permission preferences
-    let result =
-      Services.perms.testExactPermissionFromPrincipal(request.principal,
-                                                      perm.type);
-
-    // We used to use the name "geo" for the geolocation permission, now we're
-    // using "geolocation".  We need to check both to support existing
-    // installations.
-    if ((result == Ci.nsIPermissionManager.UNKNOWN_ACTION ||
-         result == Ci.nsIPermissionManager.PROMPT_ACTION) &&
-        perm.type == "geolocation") {
-      let geoResult = Services.perms.testExactPermission(request.principal.URI,
-                                                         "geo");
-      // We override the result only if the "geo" permission was allowed or
-      // denied.
-      if (geoResult == Ci.nsIPermissionManager.ALLOW_ACTION ||
-          geoResult == Ci.nsIPermissionManager.DENY_ACTION) {
-        result = geoResult;
-      }
-    }
-
-    if (result == Ci.nsIPermissionManager.ALLOW_ACTION) {
-      request.allow();
-      return;
-    } else if (result == Ci.nsIPermissionManager.DENY_ACTION ||
-               (result == Ci.nsIPermissionManager.UNKNOWN_ACTION &&
-                UNKNOWN_FAIL.indexOf(perm.type) >= 0)) {
-      request.cancel();
-      return;
-    }
-
-    // Display a prompt at the top level
-    let {name} = WebappRT.localeManifest;
-    let requestingWindow = request.window.top;
-    let chromeWin = this._getChromeWindow(requestingWindow);
-    let bundle = Services.strings.createBundle("chrome://webapprt/locale/webapp.properties");
-
-    // Construct a prompt with share/don't and remember checkbox
-    let remember = {value: false};
-    let choice = Services.prompt.confirmEx(
-      chromeWin,
-      bundle.formatStringFromName(perm.type + ".title", [name], 1),
-      bundle.GetStringFromName(perm.type + ".description"),
-      // Set both buttons to strings with the cancel button being default
-      Ci.nsIPromptService.BUTTON_POS_1_DEFAULT |
-        Ci.nsIPromptService.BUTTON_TITLE_IS_STRING * Ci.nsIPromptService.BUTTON_POS_0 |
-        Ci.nsIPromptService.BUTTON_TITLE_IS_STRING * Ci.nsIPromptService.BUTTON_POS_1,
-      bundle.GetStringFromName(perm.type + ".allow"),
-      bundle.GetStringFromName(perm.type + ".deny"),
-      null,
-      bundle.GetStringFromName(perm.type + ".remember"),
-      remember);
-
-    let action = Ci.nsIPermissionManager.ALLOW_ACTION;
-    if (choice != 0) {
-      action = Ci.nsIPermissionManager.DENY_ACTION;
-    }
-
-    if (remember.value) {
-      // Persist the choice if the user wants to remember
-      Services.perms.addFromPrincipal(request.principal, perm.type, action);
-    } else {
-      // Otherwise allow the permission for the current session
-      Services.perms.addFromPrincipal(request.principal, perm.type, action,
-                                      Ci.nsIPermissionManager.EXPIRE_SESSION);
-    }
-
-    // Trigger the selected choice
-    if (choice == 0) {
-      request.allow();
-    }
-    else {
-      request.cancel();
-    }
-  }
-};
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentPermission]);
deleted file mode 100644
--- a/webapprt/DirectoryProvider.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-const Cu = Components.utils;
-
-const WEBAPP_REGISTRY_DIR = "WebappRegD";
-const NS_APP_CHROME_DIR_LIST = "AChromDL";
-
-Cu.import("resource://gre/modules/FileUtils.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://webapprt/modules/WebappRT.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-
-function DirectoryProvider() {}
-
-DirectoryProvider.prototype = {
-  classID: Components.ID("{e1799fda-4b2f-4457-b671-e0641d95698d}"),
-
-  QueryInterface: XPCOMUtils.generateQI([Ci.nsIDirectoryServiceProvider,
-                                         Ci.nsIDirectoryServiceProvider2]),
-
-  getFile: function(prop, persistent) {
-    if (prop == WEBAPP_REGISTRY_DIR) {
-      let dir = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
-      dir.initWithPath(WebappRT.config.registryDir);
-      return dir;
-    }
-
-    // We return null to show failure instead of throwing an error,
-    // which works with the way the interface is called (per bug 529077).
-    return null;
-  },
-
-  getFiles: function(prop, persistent) {
-    if (prop == NS_APP_CHROME_DIR_LIST) {
-      return {
-        _done: false,
-        QueryInterface: XPCOMUtils.generateQI([Ci.nsISimpleEnumerator]),
-        hasMoreElements: function() {
-          return !this._done;
-        },
-        getNext: function() {
-          this._done = true;
-          return FileUtils.getDir("AppRegD", ["chrome"], false);
-        }
-      };
-    }
-
-    return null;
-  },
-};
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DirectoryProvider]);
deleted file mode 100644
--- a/webapprt/DownloadView.jsm
+++ /dev/null
@@ -1,35 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["DownloadView"];
-
-const Cu = Components.utils;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Downloads.jsm");
-
-this.DownloadView = {
-  init: function() {
-    Downloads.getList(Downloads.ALL)
-             .then(list => list.addView(this))
-             .catch(Cu.reportError);
-  },
-
-  onDownloadAdded: function(aDownload) {
-    let dmWindow = Services.wm.getMostRecentWindow("Download:Manager");
-    if (dmWindow) {
-      dmWindow.focus();
-    } else {
-      Services.ww.openWindow(null,
-                             "chrome://webapprt/content/downloads/downloads.xul",
-                             "Download:Manager",
-                             "chrome,dialog=no,resizable",
-                             null);
-    }
-  },
-};
-
-DownloadView.init();
deleted file mode 100644
--- a/webapprt/PaymentUIGlue.js
+++ /dev/null
@@ -1,148 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const { interfaces: Ci, utils: Cu } = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-
-XPCOMUtils.defineLazyServiceGetter(this, "cpmm",
-                                  "@mozilla.org/childprocessmessagemanager;1",
-                                  "nsIMessageSender");
-
-function paymentSuccess(aRequestId) {
-  return function(aResult) {
-    closePaymentWindow(aRequestId, function() {
-      cpmm.sendAsyncMessage("Payment:Success", { requestId: aRequestId,
-                                                 result: aResult });
-    });
-  };
-}
-
-function paymentFailed(aRequestId) {
-  return function(aErrorMsg) {
-    closePaymentWindow(aRequestId, function() {
-      cpmm.sendAsyncMessage("Payment:Failed", { requestId: aRequestId,
-                                                errorMsg: aErrorMsg });
-