Backed out changeset 4d4982e04e4d (bug 1543156) for xpcshell failures on test_extension_storage_actor.js. CLOSED TREE
authorNarcis Beleuzu <nbeleuzu@mozilla.com>
Wed, 13 Nov 2019 13:36:30 +0200
changeset 501731 0a3045be7a72a15be26196a4401d0b695931387c
parent 501730 a46ef03516e66a6bd02531c651578dff1ae781fc
child 501732 710f988369e5588af9b35bf07ac6051083a3407a
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1543156
milestone72.0a1
backs out4d4982e04e4d1dd63b18b8b35bba555ec62c4e38
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
Backed out changeset 4d4982e04e4d (bug 1543156) for xpcshell failures on test_extension_storage_actor.js. CLOSED TREE
devtools/server/tests/unit/head_dbg.js
devtools/server/tests/unit/test_addon_events.js
devtools/server/tests/unit/test_addon_reload.js
devtools/server/tests/unit/test_addons_actor.js
--- a/devtools/server/tests/unit/head_dbg.js
+++ b/devtools/server/tests/unit/head_dbg.js
@@ -46,47 +46,35 @@ const { DebuggerClient } = require("devt
 const ObjectFront = require("devtools/shared/fronts/object");
 const { LongStringFront } = require("devtools/shared/fronts/string");
 const { TargetFactory } = require("devtools/client/framework/target");
 
 const { addDebuggerToGlobal } = ChromeUtils.import(
   "resource://gre/modules/jsdebugger.jsm"
 );
 
-const { AddonTestUtils } = ChromeUtils.import(
-  "resource://testing-common/AddonTestUtils.jsm"
-);
-const { getAppInfo } = ChromeUtils.import(
-  "resource://testing-common/AppInfo.jsm"
-);
-
 const systemPrincipal = Cc["@mozilla.org/systemprincipal;1"].createInstance(
   Ci.nsIPrincipal
 );
 
 var { loadSubScript, loadSubScriptWithOptions } = Services.scriptloader;
 
 /**
  * Initializes any test that needs to work with add-ons.
- *
- * Should be called once per test script that needs to use AddonTestUtils (and
- * not once per test task!).
  */
-async function startupAddonsManager() {
+function startupAddonsManager() {
   // Create a directory for extensions.
   const profileDir = do_get_profile().clone();
   profileDir.append("extensions");
 
-  /* global globalThis */
-  /* See Bug 1595810 to add globalThis to eslint */
-  AddonTestUtils.init(globalThis);
-  AddonTestUtils.overrideCertDB();
-  AddonTestUtils.appInfo = getAppInfo();
+  const internalManager = Cc["@mozilla.org/addons/integration;1"]
+    .getService(Ci.nsIObserver)
+    .QueryInterface(Ci.nsITimerCallback);
 
-  await AddonTestUtils.promiseStartupManager();
+  internalManager.observe(null, "addons-startup", null);
 }
 
 async function createTargetForFakeTab(title) {
   const client = await startTestDebuggerServer(title);
 
   const tabs = await listTabs(client);
   return findTab(tabs, title);
 }
--- a/devtools/server/tests/unit/test_addon_events.js
+++ b/devtools/server/tests/unit/test_addon_events.js
@@ -1,21 +1,22 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 /* eslint-disable no-shadow */
 
 "use strict";
 
 const { AddonManager } = require("resource://gre/modules/AddonManager.jsm");
+
+startupAddonsManager();
+
 add_task(async function testReloadExitedAddon() {
   // Force sync plugin loading to avoid spurious install events from plugins.
   Services.prefs.setBoolPref("plugin.load_flash_only", false);
 
-  await startupAddonsManager();
-
   DebuggerServer.init();
   DebuggerServer.registerAllActors();
 
   const client = new DebuggerClient(DebuggerServer.connectPipe());
   await client.connect();
 
   // Retrieve the current list of addons to be notified of the next list update.
   // We will also call listAddons every time we receive the event "addonListChanged" for
--- a/devtools/server/tests/unit/test_addon_reload.js
+++ b/devtools/server/tests/unit/test_addon_reload.js
@@ -1,16 +1,18 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 /* eslint-disable no-shadow */
 
 "use strict";
 
 const { AddonManager } = require("resource://gre/modules/AddonManager.jsm");
 
+startupAddonsManager();
+
 function promiseAddonEvent(event) {
   return new Promise(resolve => {
     const listener = {
       [event]: function(...args) {
         AddonManager.removeAddonListener(listener);
         resolve(args);
       },
     };
@@ -42,18 +44,16 @@ async function reloadAddon(addonFront) {
 }
 
 function getSupportFile(path) {
   const allowMissing = false;
   return do_get_file(path, allowMissing);
 }
 
 add_task(async function testReloadExitedAddon() {
-  await startupAddonsManager();
-
   DebuggerServer.init();
   DebuggerServer.registerAllActors();
 
   const client = new DebuggerClient(DebuggerServer.connectPipe());
   await client.connect();
 
   // Install our main add-on to trigger reloads on.
   const addonFile = getSupportFile("addons/web-extension");
--- a/devtools/server/tests/unit/test_addons_actor.js
+++ b/devtools/server/tests/unit/test_addons_actor.js
@@ -1,31 +1,27 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 /* eslint-disable no-shadow */
 
 "use strict";
 
+startupAddonsManager();
+
 async function connect() {
   DebuggerServer.init();
   DebuggerServer.registerAllActors();
 
   const client = new DebuggerClient(DebuggerServer.connectPipe());
   await client.connect();
 
   const addons = await client.mainRoot.getFront("addons");
   return [client, addons];
 }
 
-// The AddonsManager test helper can only be called once per test script.
-// This `setup` task will run first.
-add_task(async function setup() {
-  await startupAddonsManager();
-});
-
 add_task(async function testSuccessfulInstall() {
   const [client, addons] = await connect();
 
   const allowMissing = false;
   const usePlatformSeparator = true;
   const addonPath = getFilePath(
     "addons/web-extension",
     allowMissing,