Backed out changeset de21696c8853 (bug 654423) on suspicion of causing Windows

debug Mochitest-other permaorange from CLOSED TREE.

--HG--
extra : rebase_source : 2d88de067d1b4316077dba8313b947175c17d861
This commit is contained in:
Boris Zbarsky 2011-05-05 17:45:56 -04:00
parent f83cc47bbe
commit 9de4c7fe75

View File

@ -2,51 +2,63 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
function test() {
let win, contentWindow, originalTab, newTab1, newTab2;
waitForExplicitFinish();
let originalTab = gBrowser.visibleTabs[0];
let newTab1 = gBrowser.addTab("about:blank", { skipAnimation: true });
let newTab2 = gBrowser.addTab("about:blank", { skipAnimation: true });
gBrowser.pinTab(newTab1);
let contentWindow;
let partOne = function() {
window.removeEventListener("tabviewshown", partOne, false);
contentWindow = document.getElementById("tab-view").contentWindow;
is(contentWindow.GroupItems.groupItems.length, 1, "There is only one group item");
let partOne = function () {
let groupItem = contentWindow.GroupItems.groupItems[0];
let tabItems = groupItem.getChildren();
is(tabItems.length, 2, "There are two tab items in that group item");
is(tabItems[0].tab, originalTab, "The first tab item is linked to the first tab");
is(tabItems[1].tab, newTab2, "The second tab item is linked to the second tab");
hideTabView(partTwo, win);
window.addEventListener("tabviewhidden", partTwo, false);
TabView.toggle();
};
let partTwo = function () {
win.gBrowser.unpinTab(newTab1);
showTabView(partThree, win);
let partTwo = function() {
window.removeEventListener("tabviewhidden", partTwo, false);
gBrowser.unpinTab(newTab1);
window.addEventListener("tabviewshown", partThree, false);
TabView.toggle();
};
let partThree = function () {
let partThree = function() {
window.removeEventListener("tabviewshown", partThree, false);
let tabItems = contentWindow.GroupItems.groupItems[0].getChildren();
is(tabItems.length, 3, "There are three tab items in that group item");
is(tabItems[0].tab, win.gBrowser.tabs[0], "The first tab item is linked to the first tab");
is(tabItems[1].tab, win.gBrowser.tabs[1], "The second tab item is linked to the second tab");
is(tabItems[2].tab, win.gBrowser.tabs[2], "The third tab item is linked to the third tab");
is(tabItems[0].tab, gBrowser.visibleTabs[0], "The first tab item is linked to the first tab");
is(tabItems[1].tab, gBrowser.visibleTabs[1], "The second tab item is linked to the second tab");
is(tabItems[2].tab, gBrowser.visibleTabs[2], "The third tab item is linked to the third tab");
window.addEventListener("tabviewhidden", endGame, false);
TabView.toggle();
};
let endGame = function() {
window.removeEventListener("tabviewhidden", endGame, false);
gBrowser.removeTab(newTab1);
gBrowser.removeTab(newTab2);
finish();
};
let onLoad = function (tvwin) {
win = tvwin;
registerCleanupFunction(function () win.close());
for (let i = 0; i < 2; i++)
win.gBrowser.loadOneTab("about:blank", {inBackground: true});
[originalTab, newTab1, newTab2] = win.gBrowser.tabs;
win.gBrowser.pinTab(newTab1);
};
let onShow = function () {
contentWindow = win.TabView.getContentWindow();
is(contentWindow.GroupItems.groupItems.length, 1, "There is only one group item");
partOne();
};
waitForExplicitFinish();
newWindowWithTabView(onShow, onLoad);
window.addEventListener("tabviewshown", partOne, false);
TabView.toggle();
}