Bug 1371509 - Make the test browser_auto_close_window.js wait for the correct URL before continuing. r=Gijs, a=test-only
authorFelipe Gomes <felipc@gmail.com>
Mon, 22 Oct 2018 21:02:55 +0000
changeset 501154 9a5723abbaf07e35ce0eb394db045249d4a54b8b
parent 501153 75bdd5efc455dcd784b07bed04cd36dabe1aa159
child 501155 a2ea2d92a10b09dedffb11e75a030fb5646936a6
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs, test-only
bugs1371509
milestone64.0
Bug 1371509 - Make the test browser_auto_close_window.js wait for the correct URL before continuing. r=Gijs, a=test-only 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);