Back out bug 967873 - Make browser_relatedTabs.js not race in e10s

This commit is contained in:
Bill McCloskey 2015-10-07 11:09:07 -07:00
parent b1e89d97be
commit 4abd7ee5d1

View File

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
add_task(function*() {
function test() {
is(gBrowser.tabs.length, 1, "one tab is open initially");
// Add several new tabs in sequence, interrupted by selecting a
@ -10,29 +10,26 @@ add_task(function*() {
// returning a list of opened tabs for verifying the expected order.
// The new tab behaviour is documented in bug 465673
let tabs = [];
let promises = [];
function addTab(aURL, aReferrer) {
let tab = gBrowser.addTab(aURL, {referrerURI: aReferrer});
tabs.push(tab);
return BrowserTestUtils.browserLoaded(tab.linkedBrowser);
tabs.push(gBrowser.addTab(aURL, {referrerURI: aReferrer}));
}
yield addTab("http://mochi.test:8888/#0");
addTab("http://mochi.test:8888/#0");
gBrowser.selectedTab = tabs[0];
yield addTab("http://mochi.test:8888/#1");
yield addTab("http://mochi.test:8888/#2", gBrowser.currentURI);
yield addTab("http://mochi.test:8888/#3", gBrowser.currentURI);
addTab("http://mochi.test:8888/#1");
addTab("http://mochi.test:8888/#2", gBrowser.currentURI);
addTab("http://mochi.test:8888/#3", gBrowser.currentURI);
gBrowser.selectedTab = tabs[tabs.length - 1];
gBrowser.selectedTab = tabs[0];
yield addTab("http://mochi.test:8888/#4", gBrowser.currentURI);
addTab("http://mochi.test:8888/#4", gBrowser.currentURI);
gBrowser.selectedTab = tabs[3];
yield addTab("http://mochi.test:8888/#5", gBrowser.currentURI);
addTab("http://mochi.test:8888/#5", gBrowser.currentURI);
gBrowser.removeTab(tabs.pop());
yield addTab("about:blank", gBrowser.currentURI);
addTab("about:blank", gBrowser.currentURI);
gBrowser.moveTabTo(gBrowser.selectedTab, 1);
yield addTab("http://mochi.test:8888/#6", gBrowser.currentURI);
yield addTab();
yield addTab("http://mochi.test:8888/#7");
addTab("http://mochi.test:8888/#6", gBrowser.currentURI);
addTab();
addTab("http://mochi.test:8888/#7");
function testPosition(tabNum, expectedPosition, msg) {
is(Array.indexOf(gBrowser.tabs, tabs[tabNum]), expectedPosition, msg);
@ -49,4 +46,4 @@ add_task(function*() {
testPosition(8, 9, "tab without referrer opens at the end");
tabs.forEach(gBrowser.removeTab, gBrowser);
});
}