2011-01-28 12:23:05 -08:00
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
2010-11-29 21:03:51 -08:00
|
|
|
|
|
|
|
let tabOne;
|
|
|
|
let tabTwo;
|
|
|
|
|
|
|
|
function test() {
|
|
|
|
waitForExplicitFinish();
|
|
|
|
|
|
|
|
tabOne = gBrowser.addTab("http://mochi.test:8888/");
|
2011-10-05 08:46:47 -07:00
|
|
|
tabTwo = gBrowser.addTab("http://mochi.test:8888/browser/browser/components/tabview/test/dummy_page.html");
|
2010-11-29 21:03:51 -08:00
|
|
|
|
2011-01-28 12:23:05 -08:00
|
|
|
afterAllTabsLoaded(function () {
|
|
|
|
// make sure the tab one is selected because undoCloseTab() would remove
|
|
|
|
// the selected tab if it's a blank tab.
|
|
|
|
gBrowser.selectedTab = tabOne;
|
2011-07-03 17:11:40 -07:00
|
|
|
showTabView(onTabViewWindowLoaded);
|
2010-11-29 21:03:51 -08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2011-07-03 17:11:40 -07:00
|
|
|
function onTabViewWindowLoaded() {
|
2011-01-28 12:23:05 -08:00
|
|
|
let contentWindow = TabView.getContentWindow();
|
2010-11-29 21:03:51 -08:00
|
|
|
let groupItems = contentWindow.GroupItems.groupItems;
|
|
|
|
is(groupItems.length, 1, "There is only one group");
|
|
|
|
is(groupItems[0].getChildren().length, 3, "The group has three tab items");
|
|
|
|
|
|
|
|
gBrowser.removeTab(tabTwo);
|
|
|
|
ok(TabView.isVisible(), "Tab View is still visible after removing a tab");
|
|
|
|
is(groupItems[0].getChildren().length, 2, "The group has two tab items");
|
|
|
|
|
2011-07-14 10:54:25 -07:00
|
|
|
restoreTab(function (tabTwo) {
|
2011-01-05 12:54:35 -08:00
|
|
|
ok(TabView.isVisible(), "Tab View is still visible after restoring a tab");
|
|
|
|
is(groupItems[0].getChildren().length, 3, "The group still has three tab items");
|
2011-01-28 12:23:05 -08:00
|
|
|
|
2011-01-05 12:54:35 -08:00
|
|
|
// clean up and finish
|
2011-01-28 12:23:05 -08:00
|
|
|
hideTabView(function () {
|
2011-01-05 12:54:35 -08:00
|
|
|
gBrowser.removeTab(tabOne);
|
|
|
|
gBrowser.removeTab(tabTwo);
|
|
|
|
finish();
|
2011-01-28 12:23:05 -08:00
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|