Bug 1371509 - Make the test browser_auto_close_window.js wait for the correct URL before continuing. r=Gijs
authorFelipe Gomes <felipc@gmail.com>
Mon, 22 Oct 2018 21:02:55 +0000
changeset 490822 183d44a4925963f8d2b865bff5b94fa649d5661d
parent 490821 7884434cdddeaa4c763168db3524cd785486b10d
child 490823 0289f2a3bdab2c2b12bd6bc3998bfc4db109a0fd
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersGijs
bugs1371509
milestone65.0a1
Bug 1371509 - Make the test browser_auto_close_window.js wait for the correct URL before continuing. r=Gijs Differential Revision: https://phabricator.services.mozilla.com/D9432
uriloader/exthandler/tests/mochitest/browser.ini
uriloader/exthandler/tests/mochitest/browser_auto_close_window.js
--- a/uriloader/exthandler/tests/mochitest/browser.ini
+++ b/uriloader/exthandler/tests/mochitest/browser.ini
@@ -1,13 +1,13 @@
 [DEFAULT]
 head = head.js
 support-files =
   download_page.html
   download.bin
   protocolHandler.html
 
 [browser_auto_close_window.js]
-skip-if = true # Bug 1371509
+run-if = e10s # test relies on e10s behavior
 [browser_download_always_ask_preferred_app.js]
 [browser_download_privatebrowsing.js]
 [browser_remember_download_option.js]
 [browser_web_protocol_handlers.js]
--- a/uriloader/exthandler/tests/mochitest/browser_auto_close_window.js
+++ b/uriloader/exthandler/tests/mochitest/browser_auto_close_window.js
@@ -106,18 +106,19 @@ add_task(async function new_window() {
     ok(win.closed, "window was opened and closed");
   });
 });
 
 add_task(async function nested_window_opens() {
   // Tests that the window auto-closing feature works if the download is
   // initiated by a window that, itself, has an opener (see bug 1373109).
   await BrowserTestUtils.withNewTab({ gBrowser, url: URL }, async function(outerBrowser) {
+    let secondTabPromise = BrowserTestUtils.waitForNewTab(gBrowser, `${URL}?newwin`, true);
     BrowserTestUtils.synthesizeMouseAtCenter("#open_in_new_tab", {}, outerBrowser);
-    let secondTab = await BrowserTestUtils.waitForNewTab(gBrowser, null, true);
+    let secondTab = await secondTabPromise;
     let nestedBrowser = secondTab.linkedBrowser;
 
     await ContentTask.spawn(nestedBrowser, null, function() {
       ok(content.opener, "this window has an opener");
     });
 
     await testNewTab(nestedBrowser);