Bug 1449055 Exit the toolbox process gracefully in browser_ext_addon_debugging_netmonitor.js r=rpl
authorAndrew Swan <aswan@mozilla.com>
Wed, 15 Aug 2018 06:26:16 -0700
changeset 431963 774f0b7aba0004b10107d5d28e1b608f51b3fc60
parent 431962 fd0d6079d0d2eeac50d856d4322e99b86fd9c597
child 431964 d13360c413ff6bd1fcb05201bb58ca4f61ff85bd
push id34456
push usertoros@mozilla.com
push dateThu, 16 Aug 2018 21:33:21 +0000
treeherdermozilla-central@72442cf86f54 [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();
 });