Bug 1520494 - follow-up: properly wait for the HTTP Server stop. r=Standard8
authorMarco Bonardo <mbonardo@mozilla.com>
Mon, 28 Jan 2019 16:22:38 +0000
changeset 455646 316954f2bfc30402dc1820939cf186d3860fb3e9
parent 455645 b98a72712cf47e82d4a6d8c303468f641db95d2a
child 455647 ce93f9ca0b355d92ddad1d924efa89338113b391
push id76907
push usermak77@bonardo.net
push dateMon, 28 Jan 2019 16:24:21 +0000
treeherderautoland@316954f2bfc3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8
bugs1520494
milestone66.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 1520494 - follow-up: properly wait for the HTTP Server stop. r=Standard8 Differential Revision: https://phabricator.services.mozilla.com/D17835
browser/components/urlbar/tests/browser/head-common.js
--- a/browser/components/urlbar/tests/browser/head-common.js
+++ b/browser/components/urlbar/tests/browser/head-common.js
@@ -46,17 +46,17 @@ async function withHttpServer(details = 
     try {
       await taskFn(server);
     } catch (ex) {
       throw new Error("Exception in the task function " + ex);
     }
   } finally {
     server.identity.remove(details.scheme, details.host, details.port);
     try {
-      server.stop(() => {});
+      await new Promise(resolve => server.stop(resolve));
     } catch (ex) {}
     server = null;
   }
 }
 
 function promisePopupShown(popup) {
   return BrowserTestUtils.waitForPopupEvent(popup, "shown");
 }