From fe4a3055ff3914302e279a8334ef532c76e18b0b Mon Sep 17 00:00:00 2001 From: Gabor Krizsanits Date: Tue, 31 Jan 2017 10:12:55 +0100 Subject: [PATCH] Bug 1334052 - Fixing racy tab switching. r=mrbkap --- browser/base/content/test/referrer/head.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/browser/base/content/test/referrer/head.js b/browser/base/content/test/referrer/head.js index 586156ff301b..a01604bf7b82 100644 --- a/browser/base/content/test/referrer/head.js +++ b/browser/base/content/test/referrer/head.js @@ -203,9 +203,10 @@ function referrerTestCaseLoaded(aTestNumber, aParams) { "?scheme=" + escape(test.toScheme) + "&policy=" + escape(test.policy || "") + "&rel=" + escape(test.rel || ""); - var browser = gTestWindow.gBrowser; - browser.selectedTab = browser.addTab(url, aParams); - return BrowserTestUtils.browserLoaded(browser.selectedBrowser); + let browser = gTestWindow.gBrowser; + return BrowserTestUtils.openNewForegroundTab(browser, () => { + browser.selectedTab = browser.addTab(url, aParams); + }); } /**