2011-02-03 07:59:27 -08:00
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
|
|
|
|
function test() {
|
2011-06-10 02:40:25 -07:00
|
|
|
let win, contentWindow, originalTab, newTab1, newTab2;
|
2011-02-03 07:59:27 -08:00
|
|
|
|
2011-06-10 02:40:25 -07:00
|
|
|
let partOne = function () {
|
2011-02-03 07:59:27 -08:00
|
|
|
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");
|
|
|
|
|
2011-06-10 02:40:25 -07:00
|
|
|
hideTabView(partTwo, win);
|
2011-02-03 07:59:27 -08:00
|
|
|
};
|
|
|
|
|
2011-06-10 02:40:25 -07:00
|
|
|
let partTwo = function () {
|
|
|
|
win.gBrowser.unpinTab(newTab1);
|
|
|
|
showTabView(partThree, win);
|
2011-02-03 07:59:27 -08:00
|
|
|
};
|
|
|
|
|
2011-06-10 02:40:25 -07:00
|
|
|
let partThree = function () {
|
2011-05-05 14:45:56 -07:00
|
|
|
let tabItems = contentWindow.GroupItems.groupItems[0].getChildren();
|
|
|
|
is(tabItems.length, 3, "There are three tab items in that group item");
|
2011-06-10 02:40:25 -07:00
|
|
|
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");
|
2011-02-03 07:59:27 -08:00
|
|
|
|
2011-06-10 02:40:25 -07:00
|
|
|
finish();
|
2011-02-03 07:59:27 -08:00
|
|
|
};
|
|
|
|
|
2011-06-10 02:40:25 -07:00
|
|
|
let onLoad = function (tvwin) {
|
|
|
|
win = tvwin;
|
|
|
|
registerCleanupFunction(function () win.close());
|
2011-05-03 15:36:05 -07:00
|
|
|
|
2011-06-10 02:40:25 -07:00
|
|
|
for (let i = 0; i < 2; i++)
|
|
|
|
win.gBrowser.loadOneTab("about:blank", {inBackground: true});
|
2011-05-05 14:45:56 -07:00
|
|
|
|
2011-06-10 02:40:25 -07:00
|
|
|
[originalTab, newTab1, newTab2] = win.gBrowser.tabs;
|
|
|
|
win.gBrowser.pinTab(newTab1);
|
2011-05-03 15:36:05 -07:00
|
|
|
};
|
|
|
|
|
2011-06-10 02:40:25 -07:00
|
|
|
let onShow = function () {
|
|
|
|
contentWindow = win.TabView.getContentWindow();
|
|
|
|
is(contentWindow.GroupItems.groupItems.length, 1, "There is only one group item");
|
|
|
|
|
|
|
|
partOne();
|
|
|
|
};
|
|
|
|
|
|
|
|
waitForExplicitFinish();
|
|
|
|
newWindowWithTabView(onShow, onLoad);
|
2011-02-03 07:59:27 -08:00
|
|
|
}
|