Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
4 function test() {
5 waitForExplicitFinish();
7 let origTab = gBrowser.visibleTabs[0];
8 let newTab = gBrowser.addTab();
9 gBrowser.selectedTab = newTab;
10 let relatedTab = gBrowser.addTab("about:blank", { ownerTab: newTab });
12 // init the frame, move the owner tab to a new group and close the related
13 // tab.
14 TabView._initFrame(function() {
15 let newTabGroupItemId = newTab._tabViewTabItem.parent.id;
17 is(relatedTab.owner, newTab, "The related tab's owner is the right tab");
19 // move current tab to a new group
20 TabView.moveTabTo(newTab, null);
22 // close the related tab
23 gBrowser.removeTab(relatedTab);
25 is(gBrowser.visibleTabs.length, 1, "The number of visible tabs is 1");
26 is(gBrowser.visibleTabs[0], origTab,
27 "The original tab is the only visible tab");
28 isnot(newTab._tabViewTabItem.parent.id, newTabGroupItemId,
29 "The moved tab item has a new group id");
31 // clean up
32 gBrowser.removeTab(newTab);
34 finish();
35 });
36 }