From 714a558c3e06370ba1cc7db904f2bb54c2da1026 Mon Sep 17 00:00:00 2001 From: Dorel Luca Date: Wed, 14 Mar 2018 12:35:38 +0200 Subject: [PATCH] Backed out changeset ae1924aff61b (bug 1443457) as requested by developer --HG-- rename : devtools/client/webconsole/new-console-output/test/mochitest/browser_console_devtools_loader_exception.js => devtools/client/webconsole/new-console-output/test/mochitest/browser_console_addonsdk_loader_exception.js rename : devtools/client/webconsole/test/browser_console_devtools_loader_exception.js => devtools/client/webconsole/test/browser_console_addonsdk_loader_exception.js --- .../addon-source/browser_dbg_addon3/lib/main.js | 8 ++++---- devtools/client/framework/devtools-browser.js | 8 ++++---- devtools/client/framework/devtools.js | 2 +- .../new-console-output/test/mochitest/browser.ini | 2 +- ...> browser_console_addonsdk_loader_exception.js} | 6 +++--- devtools/client/webconsole/test/browser.ini | 2 +- ...> browser_console_addonsdk_loader_exception.js} | 4 ++-- devtools/server/main.js | 2 +- .../server/tests/mochitest/test_getProcess.html | 14 +++++++------- devtools/shared/base-loader.js | 2 +- devtools/shared/builtin-modules.js | 6 +++--- .../mochitest-devtools-chrome-e10s.runtimes.json | 10 +++++----- 12 files changed, 33 insertions(+), 33 deletions(-) rename devtools/client/webconsole/new-console-output/test/mochitest/{browser_console_devtools_loader_exception.js => browser_console_addonsdk_loader_exception.js} (89%) rename devtools/client/webconsole/test/{browser_console_devtools_loader_exception.js => browser_console_addonsdk_loader_exception.js} (94%) diff --git a/devtools/client/debugger/test/mochitest/addon-source/browser_dbg_addon3/lib/main.js b/devtools/client/debugger/test/mochitest/addon-source/browser_dbg_addon3/lib/main.js index add241b49b1e..5324241520e9 100644 --- a/devtools/client/debugger/test/mochitest/addon-source/browser_dbg_addon3/lib/main.js +++ b/devtools/client/debugger/test/mochitest/addon-source/browser_dbg_addon3/lib/main.js @@ -9,12 +9,12 @@ var observer = { observerService.addObserver(observer, "debuggerAttached"); -var devtoolsLoaderDestroyObserver = { +var sdkLoaderDestroyObserver = { observe: function () { - // Remove all observers on devtools:loader:destroy + // Remove all observers on sdk:loader:destroy observerService.removeObserver(observer, "debuggerAttached"); - observerService.removeObserver(devtoolsLoaderDestroyObserver, "devtools:loader:destroy"); + observerService.removeObserver(sdkLoaderDestroyObserver, "sdk:loader:destroy"); } }; -observerService.addObserver(devtoolsLoaderDestroyObserver, "devtools:loader:destroy"); +observerService.addObserver(sdkLoaderDestroyObserver, "sdk:loader:destroy"); diff --git a/devtools/client/framework/devtools-browser.js b/devtools/client/framework/devtools-browser.js index e7eaa394d8df..69c1e9ac496d 100644 --- a/devtools/client/framework/devtools-browser.js +++ b/devtools/client/framework/devtools-browser.js @@ -178,7 +178,7 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = { case "quit-application": gDevToolsBrowser.destroy({ shuttingDown: true }); break; - case "devtools:loader:destroy": + case "sdk:loader:destroy": // This event is fired when the devtools loader unloads, which happens // only when the add-on workflow ask devtools to be reloaded. if (subject.wrappedJSObject == require("@loader/unload")) { @@ -711,7 +711,7 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = { }, /** - * Either the DevTools Loader has been destroyed by the add-on contribution + * Either the SDK Loader has been destroyed by the add-on contribution * workflow, or firefox is shutting down. * @param {boolean} shuttingDown @@ -723,7 +723,7 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = { Services.prefs.removeObserver("devtools.", gDevToolsBrowser); Services.obs.removeObserver(gDevToolsBrowser, "browser-delayed-startup-finished"); Services.obs.removeObserver(gDevToolsBrowser, "quit-application"); - Services.obs.removeObserver(gDevToolsBrowser, "devtools:loader:destroy"); + Services.obs.removeObserver(gDevToolsBrowser, "sdk:loader:destroy"); for (let win of gDevToolsBrowser._trackedBrowserWindows) { gDevToolsBrowser._forgetBrowserWindow(win); @@ -759,7 +759,7 @@ gDevTools.on("toolbox-destroyed", gDevToolsBrowser._updateMenuCheckbox); Services.obs.addObserver(gDevToolsBrowser, "quit-application"); Services.obs.addObserver(gDevToolsBrowser, "browser-delayed-startup-finished"); // Watch for module loader unload. Fires when the tools are reloaded. -Services.obs.addObserver(gDevToolsBrowser, "devtools:loader:destroy"); +Services.obs.addObserver(gDevToolsBrowser, "sdk:loader:destroy"); // Fake end of browser window load event for all already opened windows // that is already fully loaded. diff --git a/devtools/client/framework/devtools.js b/devtools/client/framework/devtools.js index a1a40d511b17..832fa82a6d12 100644 --- a/devtools/client/framework/devtools.js +++ b/devtools/client/framework/devtools.js @@ -655,7 +655,7 @@ DevTools.prototype = { }, /** - * Either the DevTools Loader has been destroyed by the add-on contribution + * Either the SDK Loader has been destroyed by the add-on contribution * workflow, or firefox is shutting down. * @param {boolean} shuttingDown diff --git a/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini b/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini index 3328c5093dfd..073a8bc03c18 100644 --- a/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini +++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini @@ -166,12 +166,12 @@ support-files = !/devtools/client/shared/test/test-actor-registry.js [browser_console.js] +[browser_console_addonsdk_loader_exception.js] [browser_console_clear_method.js] skip-if = true # Bug 1437843 [browser_console_consolejsm_output.js] [browser_console_context_menu_entries.js] [browser_console_dead_objects.js] -[browser_console_devtools_loader_exception.js] [browser_console_error_source_click.js] [browser_console_filters.js] [browser_console_nsiconsolemessage.js] diff --git a/devtools/client/webconsole/new-console-output/test/mochitest/browser_console_devtools_loader_exception.js b/devtools/client/webconsole/new-console-output/test/mochitest/browser_console_addonsdk_loader_exception.js similarity index 89% rename from devtools/client/webconsole/new-console-output/test/mochitest/browser_console_devtools_loader_exception.js rename to devtools/client/webconsole/new-console-output/test/mochitest/browser_console_addonsdk_loader_exception.js index ad95ea72a237..ba9214264dab 100644 --- a/devtools/client/webconsole/new-console-output/test/mochitest/browser_console_devtools_loader_exception.js +++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser_console_addonsdk_loader_exception.js @@ -5,13 +5,13 @@ /* import-globals-from head.js */ -// Check that exceptions from scripts loaded with the DevTools loader are +// Check that exceptions from scripts loaded with the addon-sdk loader are // opened correctly in View Source from the Browser Console. "use strict"; const TEST_URI = - "data:text/html;charset=utf8,

browser_console_devtools_loader_exception.js

"; + "data:text/html;charset=utf8,

browser_console_addonsdk_loader_exception.js

"; add_task(async function() { let wcHud = await openNewTabAndConsole(TEST_URI); @@ -20,7 +20,7 @@ add_task(async function() { let bcHud = await HUDService.toggleBrowserConsole(); ok(bcHud, "browser console opened"); - // Cause an exception in a script loaded with the DevTools loader. + // Cause an exception in a script loaded with the addon-sdk loader. let toolbox = gDevTools.getToolbox(wcHud.target); let oldPanels = toolbox._toolPanels; // non-iterable diff --git a/devtools/client/webconsole/test/browser.ini b/devtools/client/webconsole/test/browser.ini index 3e11069a30ef..f55faccd0bee 100644 --- a/devtools/client/webconsole/test/browser.ini +++ b/devtools/client/webconsole/test/browser.ini @@ -160,6 +160,7 @@ skip-if = (e10s && (os == 'win' || os == 'mac')) # Bug 1243976 [browser_bug_871156_ctrlw_close_tab.js] [browser_cached_messages.js] [browser_console.js] +[browser_console_addonsdk_loader_exception.js] [browser_console_certificate_imminent_distrust.js] [browser_console_clear_method.js] [browser_console_clear_on_reload.js] @@ -173,7 +174,6 @@ skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s [browser_console_copy_entire_message_context_menu.js] subsuite = clipboard skip-if = (os == 'linux' && bits == 32 && debug) # bug 1328915, disable linux32 debug devtools for timeouts -[browser_console_devtools_loader_exception.js] [browser_console_error_source_click.js] [browser_console_filters.js] [browser_console_iframe_messages.js] diff --git a/devtools/client/webconsole/test/browser_console_devtools_loader_exception.js b/devtools/client/webconsole/test/browser_console_addonsdk_loader_exception.js similarity index 94% rename from devtools/client/webconsole/test/browser_console_devtools_loader_exception.js rename to devtools/client/webconsole/test/browser_console_addonsdk_loader_exception.js index 1f9fd035d360..5214d9849e07 100644 --- a/devtools/client/webconsole/test/browser_console_devtools_loader_exception.js +++ b/devtools/client/webconsole/test/browser_console_addonsdk_loader_exception.js @@ -3,7 +3,7 @@ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ -// Check that exceptions from scripts loaded with the DevTools loader are +// Check that exceptions from scripts loaded with the addon-sdk loader are // opened correctly in View Source from the Browser Console. // See bug 866950. @@ -26,7 +26,7 @@ function test() { browserconsole = yield HUDService.toggleBrowserConsole(); ok(browserconsole, "browser console opened"); - // Cause an exception in a script loaded with the DevTools loader. + // Cause an exception in a script loaded with the addon-sdk loader. let toolbox = gDevTools.getToolbox(webconsole.target); let oldPanels = toolbox._toolPanels; // non-iterable diff --git a/devtools/server/main.js b/devtools/server/main.js index cff7c9ad01c2..41985c935b16 100644 --- a/devtools/server/main.js +++ b/devtools/server/main.js @@ -31,7 +31,7 @@ DevToolsUtils.defineLazyGetter(this, "generateUUID", () => { return generateUUID; }); -// Overload `Components` to prevent DevTools loader exception on Components +// Overload `Components` to prevent SDK loader exception on Components // object usage Object.defineProperty(this, "Components", { get() { diff --git a/devtools/server/tests/mochitest/test_getProcess.html b/devtools/server/tests/mochitest/test_getProcess.html index d70104ef2bd5..214f02ec4501 100644 --- a/devtools/server/tests/mochitest/test_getProcess.html +++ b/devtools/server/tests/mochitest/test_getProcess.html @@ -19,7 +19,7 @@ let {DebuggerClient} = require("devtools/shared/client/debugger-client"); let {DebuggerServer} = require("devtools/server/main"); let Services = require("Services"); -window.onload = function () { +window.onload = function() { SimpleTest.waitForExplicitFinish(); SpecialPowers.pushPrefEnv({ @@ -91,7 +91,7 @@ function runTests() { to: actor.consoleActor, type: "evaluateJS", text: "var a = 42; a" - }, function ({result}) { + }, function({result}) { ok(result, 42, "console.eval worked"); getProcessAgain(actor, content.id); @@ -113,16 +113,16 @@ function runTests() { function processScript() { ChromeUtils.import("resource://gre/modules/Services.jsm"); - let listener = function () { - Services.obs.removeObserver(listener, "devtools:loader:destroy"); + let listener = function() { + Services.obs.removeObserver(listener, "sdk:loader:destroy"); sendAsyncMessage("test:getProcess-destroy", null); }; - Services.obs.addObserver(listener, "devtools:loader:destroy"); + Services.obs.addObserver(listener, "sdk:loader:destroy"); } function closeClient() { let onLoaderDestroyed = new Promise(done => { - let processListener = function () { + let processListener = function() { Services.ppmm.removeMessageListener("test:getProcess-destroy", processListener); done(); }; @@ -132,7 +132,7 @@ function runTests() { Services.ppmm.loadProcessScript(script, true); client.close(); - onLoaderDestroyed.then(function () { + onLoaderDestroyed.then(function() { Services.ppmm.removeDelayedProcessScript(script); info("Loader destroyed in the content process"); diff --git a/devtools/shared/base-loader.js b/devtools/shared/base-loader.js index 4c511ab4896a..b9231e84dc2e 100644 --- a/devtools/shared/base-loader.js +++ b/devtools/shared/base-loader.js @@ -571,7 +571,7 @@ function unload(loader, reason) { // some modules may do cleanup in subsequent turns of event loop. Destroying // cache may cause module identity problems in such cases. let subject = { wrappedJSObject: loader.destructor }; - Services.obs.notifyObservers(subject, "devtools:loader:destroy", reason); + Services.obs.notifyObservers(subject, "sdk:loader:destroy", reason); } // Function makes new loader that can be used to load CommonJS modules. diff --git a/devtools/shared/builtin-modules.js b/devtools/shared/builtin-modules.js index 83ca7f9715c7..632f57c1b668 100644 --- a/devtools/shared/builtin-modules.js +++ b/devtools/shared/builtin-modules.js @@ -226,7 +226,7 @@ defineLazyGetter(exports.modules, "Debugger", () => { defineLazyGetter(exports.modules, "Timer", () => { let {setTimeout, clearTimeout} = require("resource://gre/modules/Timer.jsm"); - // Do not return Cu.import result, as DevTools loader would freeze Timer.jsm globals... + // Do not return Cu.import result, as SDK loader would freeze Timer.jsm globals... return { setTimeout, clearTimeout @@ -280,8 +280,8 @@ exports.globals = { URL, XMLHttpRequest, }; -// DevTools loader copy globals property descriptors on each module global -// object so that we have to memoize them from here in order to instantiate each +// SDK loader copy globals property descriptors on each module global object +// so that we have to memoize them from here in order to instanciate each // global only once. // `globals` is a cache object on which we put all global values // and we set getters on `exports.globals` returning `globals` values. diff --git a/testing/runtimes/mochitest-devtools-chrome-e10s.runtimes.json b/testing/runtimes/mochitest-devtools-chrome-e10s.runtimes.json index 064863267b3a..7d84a67ffe30 100644 --- a/testing/runtimes/mochitest-devtools-chrome-e10s.runtimes.json +++ b/testing/runtimes/mochitest-devtools-chrome-e10s.runtimes.json @@ -847,7 +847,7 @@ "devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_location_styleeditor_link.js": 4469, "devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_network_messages_click.js": 3871, "devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_nodes_select.js": 5570, - "devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_object_inspector_entries.js": 3676, + "devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_object_inspector_entries.js": 3676, "devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_observer_notifications.js": 4639, "devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_scroll.js": 3616, "devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_sourcemap_error.js": 3529, @@ -857,9 +857,9 @@ "devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_warn_about_replaced_api.js": 6869, "devtools/client/webconsole/test/browser_bug664688_sandbox_update_after_navigation.js": 3934, "devtools/client/webconsole/test/browser_cached_messages.js": 4512, - "devtools/client/webconsole/test/browser_console_consolejsm_output.js": 4138, - "devtools/client/webconsole/test/browser_console_devtools_loader_exception.js": 3748, - "devtools/client/webconsole/test/browser_console_filters.js": 4025, + "devtools/client/webconsole/test/browser_console_addonsdk_loader_exception.js": 3748, + "devtools/client/webconsole/test/browser_console_consolejsm_output.js": 4138, + "devtools/client/webconsole/test/browser_console_filters.js": 4025, "devtools/client/webconsole/test/browser_console_hide_jsterm_when_devtools_chrome_enabled_false.js": 9069, "devtools/client/webconsole/test/browser_console_history_persist.js": 7397, "devtools/client/webconsole/test/browser_console_iframe_messages.js": 5006, @@ -912,4 +912,4 @@ "devtools/server/tests/browser/browser_markers-cycle-collection.js": 5381, "devtools/server/tests/browser/browser_webextension_inspected_window.js": 5888 } -} +} \ No newline at end of file