Bug 1449055 Exit the toolbox process gracefully in browser_ext_addon_debugging_netmonitor.js r=rpl
☠☠ backed out by 9b421c484e49 ☠ ☠
authorAndrew Swan <aswan@mozilla.com>
Wed, 15 Aug 2018 06:26:16 -0700
changeset 486875 da3100049ef2c03f287fc700b620f6b622aa4749
parent 486874 0fd6d03ce4a1dff0d9d3fe9904cd940532a4a1a8
child 486876 45306ff933fe8dfad0ab11b2f4072389b15fd993
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrpl
bugs1449055
milestone63.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 1449055 Exit the toolbox process gracefully in browser_ext_addon_debugging_netmonitor.js r=rpl
browser/components/extensions/test/browser/browser_ext_addon_debugging_netmonitor.js
--- a/browser/components/extensions/test/browser/browser_ext_addon_debugging_netmonitor.js
+++ b/browser/components/extensions/test/browser/browser_ext_addon_debugging_netmonitor.js
@@ -1,12 +1,16 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
 "use strict";
 
+// There are shutdown issues for which multiple rejections are left uncaught.
+// See bug 1018184 for resolving these issues.
+PromiseTestUtils.whitelistRejectionsGlobally(/File closed/);
+
 ChromeUtils.defineModuleGetter(this, "BrowserToolboxProcess",
                                "resource://devtools/client/framework/ToolboxProcess.jsm");
 
 async function setupToolboxProcessTest(toolboxProcessScript) {
   // Enable addon debugging.
   await SpecialPowers.pushPrefEnv({
     "set": [
       // Force enabling of addons debugging
@@ -106,27 +110,26 @@ add_task(async function test_addon_debug
                       .filter(filterRequest);
 
       return requests.length > 0;
     });
 
     // Call a function defined in the target extension to make assertions
     // on the network requests collected by the netmonitor panel.
     await jsterm.execute(`testNetworkRequestReceived(${JSON.stringify(requests)});`);
+
+    await toolbox.destroy();
     /* eslint-enable no-undef */
   };
 
   await setupToolboxProcessTest(toolboxProcessScript);
   const browserToolboxProcess = new BrowserToolboxProcess({
     addonID: EXTENSION_ID,
   });
 
+  let onToolboxClose = browserToolboxProcess.once("close");
   await extension.awaitFinish("netmonitor_request_logged");
-
-  let onToolboxClose = browserToolboxProcess.once("close");
-  await browserToolboxProcess.close();
-
   await onToolboxClose;
 
   info("Addon Toolbox closed");
 
   await extension.unload();
 });