From 25fbf67b66b9c689482fd07721a5be23f861a188 Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Thu, 10 Mar 2016 14:45:59 +0100 Subject: [PATCH] Backed out changeset 878c54ec3954 (bug 1250453) --- b2g/chrome/content/shell.js | 1 + .../mochitest/test_aboutserviceworkers.html | 1 + .../shared/apps/tests/test_webapps_actor.html | 1 + devtools/shared/apps/tests/unit/head_apps.js | 3 +++ .../tests/mochi/test_dev_mode_activity.html | 2 ++ .../mochi/test_same_name_multiple_filters.html | 2 ++ dom/apps/Webapps.jsm | 1 + dom/apps/tests/file_bug_779982.js | 1 + dom/apps/tests/file_test_widget.js | 1 + dom/apps/tests/head.js | 13 +++++++++++++ dom/apps/tests/test_app_addons.html | 1 + dom/apps/tests/test_app_blocklist.html | 2 ++ dom/apps/tests/test_app_enabled.html | 2 ++ dom/apps/tests/test_app_update.html | 1 + dom/apps/tests/test_bug_1168300.html | 1 + dom/apps/tests/test_bug_765063.xul | 2 ++ dom/apps/tests/test_bug_771294.xul | 2 ++ dom/apps/tests/test_bug_795164.html | 1 + dom/apps/tests/test_bug_945152.html | 1 + dom/apps/tests/test_checkInstalled.html | 2 ++ dom/apps/tests/test_iac.html | 1 + dom/apps/tests/test_import_export.html | 2 ++ dom/apps/tests/test_install_dev_mode.html | 2 ++ .../test_install_multiple_apps_origin.html | 2 ++ dom/apps/tests/test_install_receipts.html | 2 ++ dom/apps/tests/test_langpacks.html | 1 + .../tests/test_marketplace_pkg_install.html | 1 + dom/apps/tests/test_packaged_app_asmjs.html | 1 + dom/apps/tests/test_packaged_app_install.html | 1 + dom/apps/tests/test_packaged_app_update.html | 1 + dom/apps/tests/test_receipt_operations.html | 2 ++ dom/apps/tests/test_signed_pkg_install.html | 1 + dom/apps/tests/test_theme_role.html | 2 ++ dom/apps/tests/test_third_party_homescreen.html | 2 ++ dom/apps/tests/test_uninstall_errors.html | 1 + dom/apps/tests/test_web_app_install.html | 2 ++ ...serElement_AllowEmbedAppsInNestedOOIframe.js | 2 ++ .../browserElement_AppFramePermission.js | 2 ++ .../browserElement_DisallowEmbedAppsInOOP.js | 2 ++ .../browserElement_MultipleAudioChannels.js | 1 + .../mochitest/browserElement_NotifyChannel.js | 1 + .../test_cache_clear_on_app_uninstall.html | 1 + dom/datastore/tests/test_app_install.html | 1 + dom/datastore/tests/test_arrays.html | 1 + dom/datastore/tests/test_basic.html | 1 + dom/datastore/tests/test_basic_worker.html | 1 + dom/datastore/tests/test_bug1008044.html | 1 + dom/datastore/tests/test_bug1058108.html | 1 + dom/datastore/tests/test_bug924104.html | 1 + dom/datastore/tests/test_bug957086.html | 1 + dom/datastore/tests/test_bug976311.html | 1 + dom/datastore/tests/test_bug986056.html | 1 + dom/datastore/tests/test_certifiedApp.html | 1 + dom/datastore/tests/test_changes.html | 1 + dom/datastore/tests/test_duplicate.html | 1 + dom/datastore/tests/test_keys.html | 1 + .../tests/test_notify_system_message.html | 1 + dom/datastore/tests/test_oop.html | 1 + dom/datastore/tests/test_oop_events.html | 1 + dom/datastore/tests/test_readonly.html | 1 + dom/datastore/tests/test_transactions.html | 1 + dom/datastore/tests/test_worker_close.html | 1 + dom/downloads/tests/shim_app_as_test.js | 1 + dom/indexedDB/test/webapp_clearBrowserData.js | 2 ++ dom/ipc/tests/test_permission_helper.js | 2 ++ dom/messages/test/test_sysmsg_registration.html | 1 + dom/requestsync/tests/test_basic_app.html | 1 + dom/security/test/csp/test_bug949549.html | 1 + .../fetch/test_fetch_app_protocol.html | 1 + .../localstorage/test_clear_browser_data.html | 3 +++ .../mochitest/notification/NotificationTest.js | 1 + .../test/mochitests/test_web_packaged_app.html | 1 + .../mochitest/tests/SimpleTest/SimpleTest.js | 1 + .../mochitest/tests/SimpleTest/TestRunner.js | 1 + .../content/SpecialPowersObserverAPI.js | 4 ++++ .../specialpowers/content/specialpowersAPI.js | 17 +++++++++++++++++ 76 files changed, 131 insertions(+) diff --git a/b2g/chrome/content/shell.js b/b2g/chrome/content/shell.js index b6242629e336..f43657a4b313 100644 --- a/b2g/chrome/content/shell.js +++ b/b2g/chrome/content/shell.js @@ -45,6 +45,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "Screenshot", "resource://gre/modules/Screenshot.jsm"); Cu.import('resource://gre/modules/Webapps.jsm'); +DOMApplicationRegistry.allAppsLaunchable = true; XPCOMUtils.defineLazyServiceGetter(Services, 'env', '@mozilla.org/process/environment;1', diff --git a/b2g/components/test/mochitest/test_aboutserviceworkers.html b/b2g/components/test/mochitest/test_aboutserviceworkers.html index e4da0a669f01..d30e58f4f652 100644 --- a/b2g/components/test/mochitest/test_aboutserviceworkers.html +++ b/b2g/components/test/mochitest/test_aboutserviceworkers.html @@ -204,6 +204,7 @@ function installApp() { function setup() { info("Setting up"); return new Promise((resolve, reject) => { + SpecialPowers.setAllAppsLaunchable(true); SpecialPowers.pushPrefEnv({"set": [ ["dom.mozBrowserFramesEnabled", true], ["dom.serviceWorkers.exemptFromPerDomainMax", true], diff --git a/devtools/shared/apps/tests/test_webapps_actor.html b/devtools/shared/apps/tests/test_webapps_actor.html index d105a55c8fbd..566692b4b55c 100644 --- a/devtools/shared/apps/tests/test_webapps_actor.html +++ b/devtools/shared/apps/tests/test_webapps_actor.html @@ -71,6 +71,7 @@ var steps = [ function() { info("== SETUP =="); // Set up + SpecialPowers.setAllAppsLaunchable(true); SpecialPowers.addPermission("webapps-manage", true, document); SpecialPowers.addPermission("browser", true, document); SpecialPowers.addPermission("embed-apps", true, document); diff --git a/devtools/shared/apps/tests/unit/head_apps.js b/devtools/shared/apps/tests/unit/head_apps.js index 0ca6cdeb2da5..eb3637cb49e3 100644 --- a/devtools/shared/apps/tests/unit/head_apps.js +++ b/devtools/shared/apps/tests/unit/head_apps.js @@ -80,7 +80,10 @@ 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; // Enable launch/close method of the webapps actor let {WebappsActor} = require("devtools/server/actors/webapps"); diff --git a/dom/activities/tests/mochi/test_dev_mode_activity.html b/dom/activities/tests/mochi/test_dev_mode_activity.html index 75629fe8bd9c..004649a544af 100644 --- a/dom/activities/tests/mochi/test_dev_mode_activity.html +++ b/dom/activities/tests/mochi/test_dev_mode_activity.html @@ -163,6 +163,8 @@ obsService.addObserver(continueTest, "new-activity-registered-failure", false); * Test dev mode activity. */ function runTest() { + SpecialPowers.setAllAppsLaunchable(true); + SpecialPowers.autoConfirmAppInstall(continueTest); yield undefined; diff --git a/dom/activities/tests/mochi/test_same_name_multiple_filters.html b/dom/activities/tests/mochi/test_same_name_multiple_filters.html index 2a3f9ba68f3b..89deb72d0206 100644 --- a/dom/activities/tests/mochi/test_same_name_multiple_filters.html +++ b/dom/activities/tests/mochi/test_same_name_multiple_filters.html @@ -124,6 +124,8 @@ function continueTest() { } function runTest() { + SpecialPowers.setAllAppsLaunchable(true); + SpecialPowers.autoConfirmAppInstall(continueTest); yield undefined; diff --git a/dom/apps/Webapps.jsm b/dom/apps/Webapps.jsm index da384bcbe1d1..a9771e663f24 100644 --- a/dom/apps/Webapps.jsm +++ b/dom/apps/Webapps.jsm @@ -196,6 +196,7 @@ this.DOMApplicationRegistry = { // Path to the webapps.json file where we store the registry data. appsFile: null, webapps: { }, + allAppsLaunchable: false, _updateHandlers: [ ], _pendingUninstalls: {}, _contentActions: new Map(), diff --git a/dom/apps/tests/file_bug_779982.js b/dom/apps/tests/file_bug_779982.js index 6c2fffbb4471..5bc26c6f0f2b 100644 --- a/dom/apps/tests/file_bug_779982.js +++ b/dom/apps/tests/file_bug_779982.js @@ -1,4 +1,5 @@ SimpleTest.waitForExplicitFinish(); +SpecialPowers.setAllAppsLaunchable(true); var fileTestOnCurrentOrigin = 'http://example.org/tests/dom/apps/tests/file_bug_779982.html'; diff --git a/dom/apps/tests/file_test_widget.js b/dom/apps/tests/file_test_widget.js index d70f182e8ef0..db0f46cc9188 100644 --- a/dom/apps/tests/file_test_widget.js +++ b/dom/apps/tests/file_test_widget.js @@ -193,6 +193,7 @@ var tests = [ // No confirmation needed when an app is installed function() { + SpecialPowers.setAllAppsLaunchable(true); SpecialPowers.autoConfirmAppInstall(() => { SpecialPowers.autoConfirmAppUninstall(runTest); }); diff --git a/dom/apps/tests/head.js b/dom/apps/tests/head.js index 662d119a0c2a..ba5a995e46fd 100644 --- a/dom/apps/tests/head.js +++ b/dom/apps/tests/head.js @@ -8,6 +8,19 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); function runAll(steps) { SimpleTest.waitForExplicitFinish(); + /** + * On Mac, apps aren't considered launchable right after they've been + * installed because the OS takes some time to detect them (so + * nsIMacWebAppUtils::pathForAppWithIdentifier() returns null). + * That causes methods like mgmt.getAll() to exclude the app from their + * results, even though the app is installed and is in the registry. + * See the tests under toolkit/webapps for a viable solution. + * + * To work around this problem, set allAppsLaunchable to true, which makes + * all apps considered as launchable. + */ + SpecialPowers.setAllAppsLaunchable(true); + // Clone the array so we don't modify the original. steps = steps.concat(); function next() { diff --git a/dom/apps/tests/test_app_addons.html b/dom/apps/tests/test_app_addons.html index b63eb7b39d04..65ff8cd8b4d8 100644 --- a/dom/apps/tests/test_app_addons.html +++ b/dom/apps/tests/test_app_addons.html @@ -104,6 +104,7 @@ function installApp(manifestURL, expectedError) { function runTest() { // Set up. + SpecialPowers.setAllAppsLaunchable(true); SpecialPowers.allowUnsignedAddons(); SpecialPowers.debugUserCustomizations(true); SpecialPowers.pushPrefEnv({'set': [ diff --git a/dom/apps/tests/test_app_blocklist.html b/dom/apps/tests/test_app_blocklist.html index 44c255a4de2b..57fc653377ac 100644 --- a/dom/apps/tests/test_app_blocklist.html +++ b/dom/apps/tests/test_app_blocklist.html @@ -113,6 +113,8 @@ function installApp(manifestURL) { * Test blocking of an add-on. */ function runTest() { + SpecialPowers.setAllAppsLaunchable(true); + SpecialPowers.autoConfirmAppInstall(continueTest); yield undefined; diff --git a/dom/apps/tests/test_app_enabled.html b/dom/apps/tests/test_app_enabled.html index 8c0cdc76968a..3e82f2c6a95d 100644 --- a/dom/apps/tests/test_app_enabled.html +++ b/dom/apps/tests/test_app_enabled.html @@ -53,6 +53,8 @@ SimpleTest.waitForExplicitFinish(); * Flip the `enabled` state of an app back and forth. */ function runTest() { + SpecialPowers.setAllAppsLaunchable(true); + SpecialPowers.autoConfirmAppInstall(continueTest); yield undefined; diff --git a/dom/apps/tests/test_app_update.html b/dom/apps/tests/test_app_update.html index 783edfbe2a62..cddb0329c2fa 100644 --- a/dom/apps/tests/test_app_update.html +++ b/dom/apps/tests/test_app_update.html @@ -61,6 +61,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=826058 function runTest() { // Set up. + SpecialPowers.setAllAppsLaunchable(true); // Test Bug 927699 - navigator.mozApps.install(url) lets NS_ERROR_FAILURE // onto the web var request = navigator.mozApps.install(""); diff --git a/dom/apps/tests/test_bug_1168300.html b/dom/apps/tests/test_bug_1168300.html index 02ffe846310b..eb79b1121542 100644 --- a/dom/apps/tests/test_bug_1168300.html +++ b/dom/apps/tests/test_bug_1168300.html @@ -40,6 +40,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1168300 function runTest() { // Set up. + SpecialPowers.setAllAppsLaunchable(true); SpecialPowers.autoConfirmAppInstall(continueTest); yield undefined; diff --git a/dom/apps/tests/test_bug_765063.xul b/dom/apps/tests/test_bug_765063.xul index 8d0ce625b417..6af892f37af0 100644 --- a/dom/apps/tests/test_bug_765063.xul +++ b/dom/apps/tests/test_bug_765063.xul @@ -20,6 +20,8 @@ SimpleTest.waitForExplicitFinish(); +SpecialPowers.setAllAppsLaunchable(true); + var mmListener = { receiveMessage: function(aMessage) { ppmm.removeMessageListener("Webapps:Install", mmListener); diff --git a/dom/apps/tests/test_bug_771294.xul b/dom/apps/tests/test_bug_771294.xul index c7f97774b656..1a5e69adaf3a 100644 --- a/dom/apps/tests/test_bug_771294.xul +++ b/dom/apps/tests/test_bug_771294.xul @@ -19,6 +19,8 @@