Bug 1420655 - Fix intermittent timeout failure on browser_contextmenu_openlink_after_tabnavigated.js; r=dao a=test-only
authorLuca Greco <lgreco@mozilla.com>
Tue, 26 Feb 2019 15:42:55 +0000
changeset 516253 2434050fd81f94fa85ddbc6b297dc6e2d5695310
parent 516252 99945d90f1ea1f1d47d9b1f4d5bb869d3e8e6d79
child 516254 d2b361779d686d425c0c250b491421ffc34a2a32
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao, test-only
bugs1420655
milestone66.0
Bug 1420655 - Fix intermittent timeout failure on browser_contextmenu_openlink_after_tabnavigated.js; r=dao a=test-only Differential Revision: https://phabricator.services.mozilla.com/D21216
browser/base/content/test/tabs/browser_contextmenu_openlink_after_tabnavigated.js
--- a/browser/base/content/test/tabs/browser_contextmenu_openlink_after_tabnavigated.js
+++ b/browser/base/content/test/tabs/browser_contextmenu_openlink_after_tabnavigated.js
@@ -15,29 +15,26 @@ add_task(async function test_contextmenu
   }, gBrowser.selectedBrowser);
   await awaitPopupShown;
   info("Popup Shown");
 
   info("Navigate the tab with the opened context menu");
   BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "about:blank");
   await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
 
-  let awaitNewTabOpen = BrowserTestUtils.waitForNewTab(gBrowser, "http://example.com/");
+  let awaitNewTabOpen = BrowserTestUtils.waitForNewTab(gBrowser, "http://example.com/", true);
 
   info("Click the 'open link in new tab' menu item");
   let openLinkMenuItem = contextMenu.querySelector("#context-openlinkintab");
   openLinkMenuItem.click();
 
   info("Wait for the new tab to be opened");
   const newTab = await awaitNewTabOpen;
 
   // Close the contextMenu popup if it has not been closed yet.
   contextMenu.hidePopup();
 
-  await BrowserTestUtils.browserLoaded(newTab.linkedBrowser);
-  const newTabURL = await ContentTask.spawn(newTab.linkedBrowser, null, async function() {
-    return content.location.href;
-  });
-  is(newTabURL, "http://example.com/", "Got the expected URL loaded in the new tab");
+  is(newTab.linkedBrowser.currentURI.spec, "http://example.com/",
+     "Got the expected URL loaded in the new tab");
 
   BrowserTestUtils.removeTab(newTab);
   BrowserTestUtils.removeTab(tab);
 });