Bug 1420655 - Fix intermittent timeout failure on browser_contextmenu_openlink_after_tabnavigated.js; r=dao
authorLuca Greco <lgreco@mozilla.com>
Tue, 26 Feb 2019 15:42:55 +0000
changeset 519065 855d09c66e1311ec9a7848c5160a8c8a4e610a10
parent 519064 ef831b231f7dbc497a6e26a5f46d042afd677da1
child 519066 355463041f49af2535bd8d13da17c66a77bc0ef8
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1420655
milestone67.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 1420655 - Fix intermittent timeout failure on browser_contextmenu_openlink_after_tabnavigated.js; r=dao 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);
 });