From c7846e126cf3a600b02d68d0a4b8f6f303300c7c Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Fri, 22 Jul 2016 11:30:23 +0200 Subject: [PATCH] Backed out changeset 16aa7041c009 (bug 1287107) for causing xpcshell and mac tests --- b2g/chrome/content/shell.js | 106 +++++++++- b2g/components/Bootstraper.jsm | 9 +- b2g/components/GaiaChrome.cpp | 188 ------------------ b2g/components/GaiaChrome.h | 44 ---- b2g/components/SafeMode.jsm | 110 +++++----- b2g/components/moz.build | 11 - b2g/components/nsIGaiaChrome.idl | 15 -- b2g/installer/package-manifest.in | 1 - caps/tests/mochitest/chrome.ini | 2 +- devtools/shared/apps/tests/mochitest.ini | 2 +- dom/apps/AppsServiceChild.jsm | 2 +- dom/apps/PermissionsTable.jsm | 6 - dom/apps/Webapps.jsm | 3 +- dom/apps/tests/mochitest.ini | 2 +- dom/broadcastchannel/tests/mochitest.ini | 4 +- dom/cache/test/mochitest/mochitest.ini | 2 +- dom/indexedDB/test/mochitest.ini | 6 +- dom/ipc/tests/mochitest.ini | 10 +- dom/security/test/csp/chrome.ini | 2 +- dom/security/test/csp/mochitest.ini | 2 +- dom/tests/mochitest/fetch/mochitest.ini | 2 +- .../mochitest/localstorage/mochitest.ini | 2 +- extensions/cookie/test/chrome.ini | 2 +- js/xpconnect/src/nsXPConnect.cpp | 10 +- netwerk/test/mochitests/mochitest.ini | 2 +- .../tests/Harness_sanity/mochitest.ini | 4 +- 26 files changed, 190 insertions(+), 359 deletions(-) delete mode 100644 b2g/components/GaiaChrome.cpp delete mode 100644 b2g/components/GaiaChrome.h delete mode 100644 b2g/components/nsIGaiaChrome.idl diff --git a/b2g/chrome/content/shell.js b/b2g/chrome/content/shell.js index 706dcbeb0250..e206f0e6ded1 100644 --- a/b2g/chrome/content/shell.js +++ b/b2g/chrome/content/shell.js @@ -38,6 +38,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "SystemAppProxy", XPCOMUtils.defineLazyModuleGetter(this, "Screenshot", "resource://gre/modules/Screenshot.jsm"); +Cu.import('resource://gre/modules/Webapps.jsm'); + XPCOMUtils.defineLazyServiceGetter(Services, 'env', '@mozilla.org/process/environment;1', 'nsIEnvironment'); @@ -354,7 +356,6 @@ var shell = { alert(msg); return; } - let manifestURL = this.manifestURL; // { + if (!aManifest) + return; + + let manifest = new ManifestHelper(aManifest, json.origin, + json.manifestURL); + let payload = { + timestamp: json.timestamp, + url: manifest.fullLaunchPath(json.startPoint), + manifestURL: json.manifestURL + }; + shell.sendCustomEvent("webapps-launch", payload); + }); + break; + case "webapps-ask-install": + id = this.registerInstaller(json); + shell.sendChromeEvent({ + type: "webapps-ask-install", + id: id, + app: json.app + }); + break; + case "webapps-ask-uninstall": + id = this.registerInstaller(json); + shell.sendChromeEvent({ + type: "webapps-ask-uninstall", + id: id, + app: json.app + }); + break; + case "webapps-close": + shell.sendCustomEvent("webapps-close", { + "manifestURL": json.manifestURL + }); + break; + } + } +} + var KeyboardHelper = { handleEvent: function keyboard_handleEvent(detail) { switch (detail.type) { diff --git a/b2g/components/Bootstraper.jsm b/b2g/components/Bootstraper.jsm index 3d3fb37d916c..8d9cc4d08887 100644 --- a/b2g/components/Bootstraper.jsm +++ b/b2g/components/Bootstraper.jsm @@ -12,6 +12,7 @@ const Cu = Components.utils; const CC = Components.Constructor; Cu.import("resource://gre/modules/Services.jsm"); +Cu.import("resource://gre/modules/Webapps.jsm"); Cu.import("resource://gre/modules/AppsUtils.jsm"); function debug(aMsg) { @@ -58,7 +59,7 @@ this.Bootstraper = { isPackage: false }; - //DOMApplicationRegistry.confirmInstall(appData, null, aResolve); + DOMApplicationRegistry.confirmInstall(appData, null, aResolve); }); }, @@ -101,9 +102,6 @@ this.Bootstraper = { * cleanly replace it by the current one. */ uninstallPreviousSystemApp: function() { - // TODO: FIXME - return Promise.resolve(); - let oldManifestURL; try{ oldManifestURL = Services.prefs.getCharPref("b2g.system_manifest_url"); @@ -145,7 +143,8 @@ this.Bootstraper = { } return new Promise((aResolve, aReject) => { - this.uninstallPreviousSystemApp.bind(this) + DOMApplicationRegistry.registryReady + .then(this.uninstallPreviousSystemApp.bind(this)) .then(this.loadManifest.bind(this)) .then(this.installSystemApp.bind(this)) .then(this.configure.bind(this)) diff --git a/b2g/components/GaiaChrome.cpp b/b2g/components/GaiaChrome.cpp deleted file mode 100644 index 2b53750c2c9a..000000000000 --- a/b2g/components/GaiaChrome.cpp +++ /dev/null @@ -1,188 +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/. */ - -#include "GaiaChrome.h" - -#include "nsAppDirectoryServiceDefs.h" -#include "nsChromeRegistry.h" -#include "nsDirectoryServiceDefs.h" -#include "nsLocalFile.h" -#include "nsXULAppAPI.h" - -#include "mozilla/ClearOnShutdown.h" -#include "mozilla/ModuleUtils.h" -#include "mozilla/Services.h" -#include "mozilla/FileLocation.h" - -#define NS_GAIACHROME_CID \ - { 0x83f8f999, 0x6b87, 0x4dd8, { 0xa0, 0x93, 0x72, 0x0b, 0xfb, 0x67, 0x4d, 0x38 } } - -using namespace mozilla; - -StaticRefPtr gGaiaChrome; - -NS_IMPL_ISUPPORTS(GaiaChrome, nsIGaiaChrome) - -GaiaChrome::GaiaChrome() - : mPackageName(NS_LITERAL_CSTRING("gaia")) - , mAppsDir(NS_LITERAL_STRING("apps")) - , mDataRoot(NS_LITERAL_STRING("/data/local")) - , mSystemRoot(NS_LITERAL_STRING("/system/b2g")) -{ - MOZ_ASSERT(NS_IsMainThread()); - - GetProfileDir(); - Register(); -} - -//virtual -GaiaChrome::~GaiaChrome() -{ -} - -nsresult -GaiaChrome::GetProfileDir() -{ - nsCOMPtr profDir; - nsresult rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, - getter_AddRefs(profDir)); - NS_ENSURE_SUCCESS(rv, rv); - - rv = profDir->Clone(getter_AddRefs(mProfDir)); - NS_ENSURE_SUCCESS(rv, rv); - - return NS_OK; -} - -nsresult -GaiaChrome::ComputeAppsPath(nsIFile* aPath) -{ -#if defined(MOZ_MULET) - aPath->InitWithFile(mProfDir); -#elif defined(MOZ_WIDGET_GONK) - nsCOMPtr locationDetection = new nsLocalFile(); - locationDetection->InitWithPath(mSystemRoot); - locationDetection->Append(mAppsDir); - bool appsInSystem = EnsureIsDirectory(locationDetection); - locationDetection->InitWithPath(mDataRoot); - locationDetection->Append(mAppsDir); - bool appsInData = EnsureIsDirectory(locationDetection); - - if (!appsInData && !appsInSystem) { - printf_stderr("!!! NO root directory with apps found\n"); - MOZ_ASSERT(false); - return NS_ERROR_UNEXPECTED; - } - - aPath->InitWithPath(appsInData ? mDataRoot : mSystemRoot); -#else - return NS_ERROR_UNEXPECTED; -#endif - - aPath->Append(mAppsDir); - aPath->Append(NS_LITERAL_STRING(".")); - - nsresult rv = EnsureValidPath(aPath); - NS_ENSURE_SUCCESS(rv, rv); - - return NS_OK; -} - -bool -GaiaChrome::EnsureIsDirectory(nsIFile* aPath) -{ - bool isDir = false; - aPath->IsDirectory(&isDir); - return isDir; -} - -nsresult -GaiaChrome::EnsureValidPath(nsIFile* appsDir) -{ - // Ensure there is a valid "apps/system" directory - nsCOMPtr systemAppDir = new nsLocalFile(); - systemAppDir->InitWithFile(appsDir); - systemAppDir->Append(NS_LITERAL_STRING("system")); - - bool hasSystemAppDir = EnsureIsDirectory(systemAppDir); - if (!hasSystemAppDir) { - nsCString path; appsDir->GetNativePath(path); - // We don't want to continue if the apps path does not exists ... - printf_stderr("!!! Gaia chrome package is not a directory: %s\n", path.get()); - return NS_ERROR_UNEXPECTED; - } - - return NS_OK; -} - -NS_IMETHODIMP -GaiaChrome::Register() -{ - MOZ_ASSERT(NS_IsMainThread()); - MOZ_ASSERT(nsChromeRegistry::gChromeRegistry != nullptr); - - nsCOMPtr aPath = new nsLocalFile(); - nsresult rv = ComputeAppsPath(aPath); - NS_ENSURE_SUCCESS(rv, rv); - - FileLocation appsLocation(aPath); - nsCString uri; - appsLocation.GetURIString(uri); - - char* argv[2]; - argv[0] = (char*)mPackageName.get(); - argv[1] = (char*)uri.get(); - - nsChromeRegistry::ManifestProcessingContext cx(NS_APP_LOCATION, appsLocation); - nsChromeRegistry::gChromeRegistry->ManifestContent(cx, 0, argv, 0); - - return NS_OK; -} - -already_AddRefed -GaiaChrome::FactoryCreate() -{ - if (!XRE_IsParentProcess()) { - return nullptr; - } - - MOZ_ASSERT(NS_IsMainThread()); - - if (!gGaiaChrome) { - gGaiaChrome = new GaiaChrome(); - ClearOnShutdown(&gGaiaChrome); - } - - RefPtr service = gGaiaChrome.get(); - return service.forget(); -} - -NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(GaiaChrome, - GaiaChrome::FactoryCreate) - -NS_DEFINE_NAMED_CID(NS_GAIACHROME_CID); - -static const mozilla::Module::CIDEntry kGaiaChromeCIDs[] = { - { &kNS_GAIACHROME_CID, false, nullptr, GaiaChromeConstructor }, - { nullptr } -}; - -static const mozilla::Module::ContractIDEntry kGaiaChromeContracts[] = { - { "@mozilla.org/b2g/gaia-chrome;1", &kNS_GAIACHROME_CID }, - { nullptr } -}; - -static const mozilla::Module::CategoryEntry kGaiaChromeCategories[] = { - { "profile-after-change", "Gaia Chrome Registration", GAIACHROME_CONTRACTID }, - { nullptr } -}; - -static const mozilla::Module kGaiaChromeModule = { - mozilla::Module::kVersion, - kGaiaChromeCIDs, - kGaiaChromeContracts, - kGaiaChromeCategories -}; - -NSMODULE_DEFN(GaiaChromeModule) = &kGaiaChromeModule; diff --git a/b2g/components/GaiaChrome.h b/b2g/components/GaiaChrome.h deleted file mode 100644 index 290613b81764..000000000000 --- a/b2g/components/GaiaChrome.h +++ /dev/null @@ -1,44 +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/. */ - -#ifndef __GAIACHROME_H__ -#define __GAIACHROME_H__ - -#include "nsIGaiaChrome.h" - -#include "nsIFile.h" - -#include "nsCOMPtr.h" -#include "nsString.h" - -using namespace mozilla; - -class GaiaChrome final : public nsIGaiaChrome -{ -public: - NS_DECL_ISUPPORTS - NS_DECL_NSIGAIACHROME - - static already_AddRefed - FactoryCreate(); - -private: - nsCString mPackageName; - - nsAutoString mAppsDir; - nsAutoString mDataRoot; - nsAutoString mSystemRoot; - - nsCOMPtr mProfDir; - - GaiaChrome(); - ~GaiaChrome(); - - nsresult ComputeAppsPath(nsIFile*); - bool EnsureIsDirectory(nsIFile*); - nsresult EnsureValidPath(nsIFile*); - nsresult GetProfileDir(); -}; - -#endif // __GAIACHROME_H__ diff --git a/b2g/components/SafeMode.jsm b/b2g/components/SafeMode.jsm index 9f9342f679e5..afa88b1ad69f 100644 --- a/b2g/components/SafeMode.jsm +++ b/b2g/components/SafeMode.jsm @@ -10,6 +10,7 @@ const Cu = Components.utils; Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/AppConstants.jsm"); +Cu.import("resource://gre/modules/Webapps.jsm"); const kSafeModePref = "b2g.safe_mode"; const kSafeModePage = "safe_mode.html"; @@ -67,70 +68,71 @@ this.SafeMode = { // Load $system_app/safe_mode.html as a full screen iframe, and wait for // the user to make a choice. - let shell = SafeMode.window.shell; - let document = SafeMode.window.document; - SafeMode.window.screen.mozLockOrientation("portrait"); + return DOMApplicationRegistry.registryReady.then(() => { + let shell = SafeMode.window.shell; + let document = SafeMode.window.document; + SafeMode.window.screen.mozLockOrientation("portrait"); - let url = Services.io.newURI(shell.homeURL, null, null) - .resolve(kSafeModePage); - debug("Registry is ready, loading " + url); - let frame = document.createElementNS("http://www.w3.org/1999/xhtml", "html:iframe"); - frame.setAttribute("mozbrowser", "true"); - frame.setAttribute("mozapp", shell.manifestURL); - frame.setAttribute("id", "systemapp"); // To keep screen.js happy. - let contentBrowser = document.body.appendChild(frame); + let url = Services.io.newURI(shell.homeURL, null, null) + .resolve(kSafeModePage); + debug("Registry is ready, loading " + url); + let frame = document.createElementNS("http://www.w3.org/1999/xhtml", "html:iframe"); + frame.setAttribute("mozbrowser", "true"); + frame.setAttribute("mozapp", shell.manifestURL); + frame.setAttribute("id", "systemapp"); // To keep screen.js happy. + let contentBrowser = document.body.appendChild(frame); - return new Promise((aResolve, aReject) => { - let content = contentBrowser.contentWindow; + return new Promise((aResolve, aReject) => { + let content = contentBrowser.contentWindow; - // Stripped down version of the system app bootstrap. - function handleEvent(e) { - switch(e.type) { - case "mozbrowserloadstart": - if (content.document.location == "about:blank") { - contentBrowser.addEventListener("mozbrowserlocationchange", handleEvent, true); - contentBrowser.removeEventListener("mozbrowserloadstart", handleEvent, true); - return; - } + // Stripped down version of the system app bootstrap. + function handleEvent(e) { + switch(e.type) { + case "mozbrowserloadstart": + if (content.document.location == "about:blank") { + contentBrowser.addEventListener("mozbrowserlocationchange", handleEvent, true); + contentBrowser.removeEventListener("mozbrowserloadstart", handleEvent, true); + return; + } - notifyContentStart(); - break; - case "mozbrowserlocationchange": - if (content.document.location == "about:blank") { - return; - } + notifyContentStart(); + break; + case "mozbrowserlocationchange": + if (content.document.location == "about:blank") { + return; + } - contentBrowser.removeEventListener("mozbrowserlocationchange", handleEvent, true); - notifyContentStart(); - break; - case "mozContentEvent": - content.removeEventListener("mozContentEvent", handleEvent, true); - contentBrowser.parentNode.removeChild(contentBrowser); + contentBrowser.removeEventListener("mozbrowserlocationchange", handleEvent, true); + notifyContentStart(); + break; + case "mozContentEvent": + content.removeEventListener("mozContentEvent", handleEvent, true); + contentBrowser.parentNode.removeChild(contentBrowser); - if (e.detail == "safemode-yes") { - // Really starting in safe mode, let's disable add-ons first. - // TODO: disable add-ons - aResolve(); - } else { - aResolve(); - } - break; + if (e.detail == "safemode-yes") { + // Really starting in safe mode, let's disable add-ons first. + DOMApplicationRegistry.disableAllAddons().then(aResolve); + } else { + aResolve(); + } + break; + } } - } - function notifyContentStart() { - let window = SafeMode.window; - window.shell.sendEvent(window, "SafeModeStart"); - contentBrowser.setVisible(true); + function notifyContentStart() { + let window = SafeMode.window; + window.shell.sendEvent(window, "SafeModeStart"); + contentBrowser.setVisible(true); - // browser-ui-startup-complete is used by the AppShell to stop the - // boot animation and start gecko rendering. - Services.obs.notifyObservers(null, "browser-ui-startup-complete", ""); - content.addEventListener("mozContentEvent", handleEvent, true); - } + // browser-ui-startup-complete is used by the AppShell to stop the + // boot animation and start gecko rendering. + Services.obs.notifyObservers(null, "browser-ui-startup-complete", ""); + content.addEventListener("mozContentEvent", handleEvent, true); + } - contentBrowser.addEventListener("mozbrowserloadstart", handleEvent, true); - contentBrowser.src = url; + contentBrowser.addEventListener("mozbrowserloadstart", handleEvent, true); + contentBrowser.src = url; + }); }); }, diff --git a/b2g/components/moz.build b/b2g/components/moz.build index f4d760693884..3abb8432191b 100644 --- a/b2g/components/moz.build +++ b/b2g/components/moz.build @@ -79,18 +79,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk': ] XPIDL_SOURCES += [ - 'nsIGaiaChrome.idl', 'nsISystemMessagesInternal.idl' ] XPIDL_MODULE = 'gaia_chrome' - -UNIFIED_SOURCES += [ - 'GaiaChrome.cpp' -] - -LOCAL_INCLUDES += [ - '/chrome' -] - -FINAL_LIBRARY = 'xul' diff --git a/b2g/components/nsIGaiaChrome.idl b/b2g/components/nsIGaiaChrome.idl deleted file mode 100644 index 8e66d8456ffd..000000000000 --- a/b2g/components/nsIGaiaChrome.idl +++ /dev/null @@ -1,15 +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/. */ - -#include "nsISupports.idl" - -[scriptable, uuid(92a18a98-ab5d-4d02-a024-bdbb3bc89ce1)] -interface nsIGaiaChrome : nsISupports -{ - void register(); -}; - -%{ C++ -#define GAIACHROME_CONTRACTID "@mozilla.org/b2g/gaia-chrome;1" -%} diff --git a/b2g/installer/package-manifest.in b/b2g/installer/package-manifest.in index 289fa7944faa..8e97297a559b 100644 --- a/b2g/installer/package-manifest.in +++ b/b2g/installer/package-manifest.in @@ -231,7 +231,6 @@ #endif @RESPATH@/components/find.xpt @RESPATH@/components/gfx.xpt -@RESPATH@/components/gaia_chrome.xpt @RESPATH@/components/hal.xpt @RESPATH@/components/html5.xpt @RESPATH@/components/htmlparser.xpt diff --git a/caps/tests/mochitest/chrome.ini b/caps/tests/mochitest/chrome.ini index 7cea4f548de1..2d1d24ec38ab 100644 --- a/caps/tests/mochitest/chrome.ini +++ b/caps/tests/mochitest/chrome.ini @@ -9,4 +9,4 @@ support-files = [test_disableScript.xul] [test_principal_jarprefix_origin_appid_appstatus.html] # jarPrefix test doesn't work on Windows, see bug 776296. -skip-if = true ### Bug 1255339: blacklist because no more mozApps +skip-if = os == "win" diff --git a/devtools/shared/apps/tests/mochitest.ini b/devtools/shared/apps/tests/mochitest.ini index aad38d79d97a..1d9fdeb412dd 100644 --- a/devtools/shared/apps/tests/mochitest.ini +++ b/devtools/shared/apps/tests/mochitest.ini @@ -1,5 +1,5 @@ [DEFAULT] -skip-if = true ### Bug 1255339: blacklist because no more mozApps +skip-if = (buildapp != 'b2g' && buildapp != 'mulet') support-files = debugger-protocol-helper.js redirect.sjs diff --git a/dom/apps/AppsServiceChild.jsm b/dom/apps/AppsServiceChild.jsm index e8adfe4ce2a9..b4c569ad2408 100644 --- a/dom/apps/AppsServiceChild.jsm +++ b/dom/apps/AppsServiceChild.jsm @@ -109,7 +109,7 @@ this.DOMApplicationRegistry = { // We need to prime the cache with the list of apps. let list = this.cpmm.sendSyncMessage("Webapps:GetList", { })[0]; - this.webapps = list ? list.webapps : { }; + this.webapps = list.webapps; // We need a fast mapping from localId -> app, so we add an index. // We also add the manifest to the app object. this.localIdIndex = { }; diff --git a/dom/apps/PermissionsTable.jsm b/dom/apps/PermissionsTable.jsm index 40d7850ac842..2acb433fb70d 100644 --- a/dom/apps/PermissionsTable.jsm +++ b/dom/apps/PermissionsTable.jsm @@ -502,12 +502,6 @@ this.PermissionsTable = { geolocation: { app: DENY_ACTION, privileged: DENY_ACTION, certified: ALLOW_ACTION - }, - "previously-certified-app": { - app: DENY_ACTION, - trusted: DENY_ACTION, - privileged: DENY_ACTION, - certified: ALLOW_ACTION } }; diff --git a/dom/apps/Webapps.jsm b/dom/apps/Webapps.jsm index 0ab4e96cca7c..11d05e0f3822 100644 --- a/dom/apps/Webapps.jsm +++ b/dom/apps/Webapps.jsm @@ -4814,5 +4814,4 @@ AppcacheObserver.prototype = { } }; -// FIXME: Properly remove Cu.import(Webapps.jsm) from every place. -//DOMApplicationRegistry.init(); +DOMApplicationRegistry.init(); diff --git a/dom/apps/tests/mochitest.ini b/dom/apps/tests/mochitest.ini index e80fa10f47b8..b2802d7816d4 100644 --- a/dom/apps/tests/mochitest.ini +++ b/dom/apps/tests/mochitest.ini @@ -1,5 +1,5 @@ [DEFAULT] -skip-if = true ### Bug 1255339: blacklist because no more mozApps +skip-if = buildapp != 'b2g' && buildapp != 'mulet' support-files = addons/application.zip addons/invalid.webapp diff --git a/dom/broadcastchannel/tests/mochitest.ini b/dom/broadcastchannel/tests/mochitest.ini index 085243c0fcbb..58a58e547386 100644 --- a/dom/broadcastchannel/tests/mochitest.ini +++ b/dom/broadcastchannel/tests/mochitest.ini @@ -21,9 +21,9 @@ support-files = [test_broadcastchannel_worker.html] [test_broadcastchannel_worker_alive.html] [test_broadcastchannel_mozbrowser.html] -skip-if = true ### Bug 1255339: blacklist because no more mozApps +skip-if = buildapp != 'mulet' [test_broadcastchannel_mozbrowser2.html] -skip-if = true ### Bug 1255339: blacklist because no more mozApps +skip-if = buildapp != 'mulet' [test_bfcache.html] [test_invalidState.html] [test_ordering.html] diff --git a/dom/cache/test/mochitest/mochitest.ini b/dom/cache/test/mochitest/mochitest.ini index f20e72bf1c33..5933c9d2f76d 100644 --- a/dom/cache/test/mochitest/mochitest.ini +++ b/dom/cache/test/mochitest/mochitest.ini @@ -42,7 +42,7 @@ support-files = [test_cache_restart.html] [test_cache_shrink.html] [test_cache_clear_on_app_uninstall.html] - skip-if = true || e10s # bug 1178685 ### Bug 1255339: blacklist because no more mozApps + skip-if = buildapp != 'mulet' || e10s # bug 1178685 [test_cache_orphaned_cache.html] [test_cache_orphaned_body.html] [test_cache_untrusted.html] diff --git a/dom/indexedDB/test/mochitest.ini b/dom/indexedDB/test/mochitest.ini index 43bd6a1144c1..5d231194c35e 100644 --- a/dom/indexedDB/test/mochitest.ini +++ b/dom/indexedDB/test/mochitest.ini @@ -384,14 +384,14 @@ skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Bug 931116 [test_webapp_clearBrowserData_inproc_inproc.html] # The clearBrowserData tests are only supposed to run in the main process. # They currently time out on android. -skip-if = true ### Bug 1255339: blacklist because no more mozApps +skip-if = buildapp == 'b2g' || e10s || toolkit == 'android' [test_webapp_clearBrowserData_inproc_oop.html] # The clearBrowserData tests are only supposed to run in the main process. # They currently time out on android. -skip-if = true ### Bug 1255339: blacklist because no more mozApps +skip-if = buildapp == 'b2g' || e10s || toolkit == 'android' [test_webapp_clearBrowserData_oop_inproc.html] # The clearBrowserData tests are only supposed to run in the main process. # They currently time out on android. -skip-if = true ### Bug 1255339: blacklist because no more mozApps +skip-if = buildapp == 'b2g' || e10s || toolkit == 'android' [test_serviceworker.html] skip-if = buildapp == 'b2g' diff --git a/dom/ipc/tests/mochitest.ini b/dom/ipc/tests/mochitest.ini index 6d96800297be..ec2f96f581be 100644 --- a/dom/ipc/tests/mochitest.ini +++ b/dom/ipc/tests/mochitest.ini @@ -22,11 +22,11 @@ skip-if = toolkit == 'cocoa' # disabled due to hangs, see changeset 6852e7c47edf [test_CrashService_crash.html] skip-if = !(crashreporter && !e10s && (toolkit == 'gtk2' || toolkit == 'gtk3' || toolkit == 'cocoa' || toolkit == 'windows') && (buildapp != 'b2g' || toolkit == 'gonk') && (buildapp != 'mulet')) # TC: Bug 1144079 - Re-enable Mulet mochitests and reftests taskcluster-specific disables. [test_permission_for_in_process_app.html] -skip-if = e10s || true || os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app ### Bug 1255339: blacklist because no more mozApps +skip-if = e10s || (buildapp != 'b2g' && buildapp != 'mulet') || os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app support-files = test_permission_helper.js [test_permission_for_oop_app.html] -skip-if = true || os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app ### Bug 1255339: blacklist because no more mozApps +skip-if = (buildapp != 'b2g' && buildapp != 'mulet') || os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app support-files = file_app.sjs file_app.template.webapp @@ -34,7 +34,7 @@ support-files = test_permission_embed.html test_permission_framescript.js [test_permission_for_nested_oop_app.html] -skip-if = true || os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app ### Bug 1255339: blacklist because no more mozApps +skip-if = (buildapp != 'b2g' && buildapp != 'mulet') || os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app support-files = file_app.sjs file_app.template.webapp @@ -42,7 +42,7 @@ support-files = test_permission_embed.html test_permission_framescript.js [test_permission_for_two_oop_apps.html] -skip-if = true || os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app ### Bug 1255339: blacklist because no more mozApps +skip-if = (buildapp != 'b2g' && buildapp != 'mulet') || os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app support-files = file_app.sjs file_app.template.webapp @@ -50,7 +50,7 @@ support-files = test_permission_embed.html test_permission_framescript.js [test_permission_when_oop_app_crashes.html] -skip-if = true || os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app ### Bug 1255339: blacklist because no more mozApps +skip-if = buildapp != 'b2g' || os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app support-files = file_app.sjs file_app.template.webapp diff --git a/dom/security/test/csp/chrome.ini b/dom/security/test/csp/chrome.ini index 6376d35d7208..548e06ce76e0 100644 --- a/dom/security/test/csp/chrome.ini +++ b/dom/security/test/csp/chrome.ini @@ -1,5 +1,5 @@ [DEFAULT] -skip-if = true ### Bug 1255339: blacklist because no more mozApps +skip-if = buildapp == 'b2g' || os == 'android' support-files = !/dom/security/test/csp/file_bug768029.html diff --git a/dom/security/test/csp/mochitest.ini b/dom/security/test/csp/mochitest.ini index 948bdf7bd530..6502d6f8d449 100644 --- a/dom/security/test/csp/mochitest.ini +++ b/dom/security/test/csp/mochitest.ini @@ -220,7 +220,7 @@ skip-if = buildapp == 'b2g' #no ssl support [test_ignore_unsafe_inline.html] [test_self_none_as_hostname_confusion.html] [test_bug949549.html] -skip-if = true ### Bug 1255339: blacklist because no more mozApps +skip-if = buildapp != 'b2g' && buildapp != 'mulet' [test_path_matching.html] [test_path_matching_redirect.html] [test_report_uri_missing_in_report_only_header.html] diff --git a/dom/tests/mochitest/fetch/mochitest.ini b/dom/tests/mochitest/fetch/mochitest.ini index f946d1f71dc1..14512e4bae59 100644 --- a/dom/tests/mochitest/fetch/mochitest.ini +++ b/dom/tests/mochitest/fetch/mochitest.ini @@ -35,7 +35,7 @@ support-files = skip-if = buildapp == 'b2g' # Bug 1137683 [test_headers_mainthread.html] [test_fetch_app_protocol.html] -skip-if = true ### Bug 1255339: blacklist because no more mozApps +skip-if = (buildapp != 'b2g' && buildapp != 'mulet') [test_fetch_basic.html] [test_fetch_basic_sw_reroute.html] skip-if = buildapp == 'b2g' # Bug 1137683 diff --git a/dom/tests/mochitest/localstorage/mochitest.ini b/dom/tests/mochitest/localstorage/mochitest.ini index 87abda407218..a44be4be01d3 100644 --- a/dom/tests/mochitest/localstorage/mochitest.ini +++ b/dom/tests/mochitest/localstorage/mochitest.ini @@ -19,7 +19,7 @@ support-files = frameLocalStorageSessionOnly.html [test_appIsolation.html] -skip-if = true || buildapp == 'b2g' || buildapp == 'mulet' || toolkit == 'android' || e10s #bug 793211 # b2g(needs https to work) b2g-debug(needs https to work) b2g-desktop(needs https to work) ### Bug 1255339: blacklist because no more mozApps +skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #bug 793211 # b2g(needs https to work) b2g-debug(needs https to work) b2g-desktop(needs https to work) [test_brokenUTF-16.html] [test_bug600307-DBOps.html] [test_bug746272-1.html] diff --git a/extensions/cookie/test/chrome.ini b/extensions/cookie/test/chrome.ini index f651d02b578c..362cb483ef22 100644 --- a/extensions/cookie/test/chrome.ini +++ b/extensions/cookie/test/chrome.ini @@ -1,5 +1,5 @@ [DEFAULT] -skip-if = true ### Bug 1255339: blacklist because no more mozApps +skip-if = buildapp == 'b2g' || os == 'android' support-files = channel_utils.js [test_app_uninstall_cookies.html] diff --git a/js/xpconnect/src/nsXPConnect.cpp b/js/xpconnect/src/nsXPConnect.cpp index dde46751140a..83fb45bd0764 100644 --- a/js/xpconnect/src/nsXPConnect.cpp +++ b/js/xpconnect/src/nsXPConnect.cpp @@ -31,8 +31,8 @@ #include "nsIObjectInputStream.h" #include "nsIObjectOutputStream.h" #include "nsScriptSecurityManager.h" -#include "nsIPermissionManager.h" #include "nsContentUtils.h" + #include "jsfriendapi.h" using namespace mozilla; @@ -442,13 +442,7 @@ InitGlobalObjectOptions(JS::CompartmentOptions& aOptions, short status = aPrincipal->GetAppStatus(); // Enable the ECMA-402 experimental formatToParts in certified apps. - uint32_t perm = nsIPermissionManager::DENY_ACTION; - nsCOMPtr permissionManager = services::GetPermissionManager(); - if (permissionManager) { - permissionManager->TestPermissionFromPrincipal(aPrincipal, "previously-certified-app", &perm); - } - - if (perm == nsIPermissionManager::ALLOW_ACTION) { + if (status == nsIPrincipal::APP_STATUS_CERTIFIED) { aOptions.creationOptions() .setExperimentalDateTimeFormatFormatToPartsEnabled(true); } diff --git a/netwerk/test/mochitests/mochitest.ini b/netwerk/test/mochitests/mochitest.ini index 95e25dc0526f..eb065d9c4269 100644 --- a/netwerk/test/mochitests/mochitest.ini +++ b/netwerk/test/mochitests/mochitest.ini @@ -25,7 +25,7 @@ support-files = [test_viewsource_unlinkable.html] [test_xhr_method_case.html] [test_web_packaged_app.html] -skip-if = true ### Bug 1255339: blacklist because no more mozApps +skip-if = buildapp != 'mulet' [test_loadinfo_redirectchain.html] skip-if = buildapp == 'b2g' #no ssl support [test_idn_redirect.html] diff --git a/testing/mochitest/tests/Harness_sanity/mochitest.ini b/testing/mochitest/tests/Harness_sanity/mochitest.ini index e3783252900c..c62066811c3e 100644 --- a/testing/mochitest/tests/Harness_sanity/mochitest.ini +++ b/testing/mochitest/tests/Harness_sanity/mochitest.ini @@ -22,7 +22,7 @@ support-files = file_SpecialPowersFrame1.html support-files = specialPowers_framescript.js [test_SpecialPowersPushAppPermissions.html] -skip-if = true ### Bug 1255339: blacklist because no more mozApps +skip-if = buildapp != 'mulet' support-files = file_app.sjs file_app.template.webapp @@ -35,7 +35,7 @@ support-files = SpecialPowersLoadChromeScript.js [test_SpecialPowersLoadPrivilegedScript.html] [test_bug649012.html] [test_bug816847.html] -skip-if = true || toolkit == 'android' || buildapp == 'b2g' || buildapp == 'mulet' || e10s #No test app installed ### Bug 1255339: blacklist because no more mozApps +skip-if = toolkit == 'android' || e10s #No test app installed [test_sanity_cleanup.html] [test_sanity_cleanup2.html] [test_sanityEventUtils.html]