|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 function test() { |
|
5 waitForExplicitFinish(); |
|
6 |
|
7 let origTab = gBrowser.visibleTabs[0]; |
|
8 let newTab = gBrowser.addTab(); |
|
9 gBrowser.selectedTab = newTab; |
|
10 let relatedTab = gBrowser.addTab("about:blank", { ownerTab: newTab }); |
|
11 |
|
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; |
|
16 |
|
17 is(relatedTab.owner, newTab, "The related tab's owner is the right tab"); |
|
18 |
|
19 // move current tab to a new group |
|
20 TabView.moveTabTo(newTab, null); |
|
21 |
|
22 // close the related tab |
|
23 gBrowser.removeTab(relatedTab); |
|
24 |
|
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"); |
|
30 |
|
31 // clean up |
|
32 gBrowser.removeTab(newTab); |
|
33 |
|
34 finish(); |
|
35 }); |
|
36 } |