Backed out changeset fd5d78e32b56 (bug 999618) for browser-chrome failures; CLOSED TREE

This commit is contained in:
Ed Morley 2014-04-25 17:59:48 +01:00
parent 6a82d86fc3
commit 55866ee9ee
5 changed files with 18 additions and 15 deletions

View File

@ -21,6 +21,8 @@ function test() {
function addTab(aURI, aIndex) {
var tab = gBrowser.addTab(aURI);
if (aIndex == 0)
gBrowser.removeTab(gBrowser.tabs[0]);
tab.linkedBrowser.addEventListener("load", function (event) {
event.currentTarget.removeEventListener("load", arguments.callee, true);
@ -30,22 +32,23 @@ function addTab(aURI, aIndex) {
}
function doTabsTest() {
is(gBrowser.tabs.length - 1, URIS.length, "Correctly opened all expected tabs");
is(gBrowser.tabs.length, URIS.length, "Correctly opened all expected tabs");
// sample of "close related tabs" feature
gBrowser.tabContainer.addEventListener("TabClose", function (event) {
event.currentTarget.removeEventListener("TabClose", arguments.callee, true);
var closedTab = event.originalTarget;
var scheme = closedTab.linkedBrowser.currentURI.scheme;
Array.slice(gBrowser.tabs).forEach(function (aTab, aIndex) {
if (aIndex != 0 && aTab != closedTab && aTab.linkedBrowser.currentURI.scheme == scheme)
Array.slice(gBrowser.tabs).forEach(function (aTab) {
if (aTab != closedTab && aTab.linkedBrowser.currentURI.scheme == scheme)
gBrowser.removeTab(aTab);
});
}, true);
gBrowser.removeTab(gBrowser.tabs[1]);
is(gBrowser.tabs.length - 1, 1, "Related tabs are not closed unexpectedly");
gBrowser.removeTab(gBrowser.tabs[0]);
is(gBrowser.tabs.length, 1, "Related tabs are not closed unexpectedly");
gBrowser.removeTab(gBrowser.tabs[1]);
gBrowser.addTab("about:blank");
gBrowser.removeTab(gBrowser.tabs[0]);
finish();
}

View File

@ -10,8 +10,8 @@ function press(key, expectedPos) {
}
function test() {
var t1 = gBrowser.addTab();
var t2 = gBrowser.addTab();
gBrowser.addTab();
gBrowser.addTab();
is(gBrowser.tabs.length, 3, "got three tabs");
is(gBrowser.tabs[0], gBrowser.selectedTab, "first tab is selected");
@ -25,6 +25,6 @@ function test() {
press("end", 2);
press("home", 0);
gBrowser.removeTab(t1);
gBrowser.removeTab(t2);
gBrowser.removeCurrentTab();
gBrowser.removeCurrentTab();
}

View File

@ -2,8 +2,6 @@ function test() {
waitForExplicitFinish();
gPrefService.setBoolPref("dom.disable_open_during_load", false);
gBrowser.selectedTab = gBrowser.addTab();
var browser = gBrowser.selectedBrowser;
browser.addEventListener("load", function () {
browser.removeEventListener("load", arguments.callee, true);
@ -53,6 +51,7 @@ function testPopupUI(win) {
if (!win.closed)
win.close();
gBrowser.addTab();
gBrowser.removeCurrentTab();
finish();
}

View File

@ -12,9 +12,10 @@ function test() {
waitForExplicitFinish();
var fileName;
gBrowser.selectedTab = gBrowser.addTab("http://mochi.test:8888/browser/browser/base/content/test/general/bug564387.html");
gBrowser.loadURI("http://mochi.test:8888/browser/browser/base/content/test/general/bug564387.html");
registerCleanupFunction(function () {
gBrowser.addTab();
gBrowser.removeCurrentTab();
});

View File

@ -80,8 +80,8 @@ var gTestSteps = [
gBrowser.addTab("about:blank", {skipAnimation: true});
while (gBrowser.tabs.length > 1) {
info("Removing tab: " + gBrowser.tabs[1].linkedBrowser.currentURI.spec);
gBrowser.selectTabAtIndex(1);
info("Removing tab: " + gBrowser.tabs[0].linkedBrowser.currentURI.spec);
gBrowser.selectTabAtIndex(0);
gBrowser.removeCurrentTab();
}
ensure_opentabs_match_db(nextStep);