browser_tabs_owner.js
Go to the documentation of this file.
1 function test() {
2  gBrowser.addTab();
3  gBrowser.addTab();
4  gBrowser.addTab();
5 
6  var tabs = gBrowser.tabContainer.childNodes;
7  var owner;
8 
9  is(tabs.length, 4, "4 tabs are open");
10 
11  owner = gBrowser.selectedTab = tabs[2];
12  BrowserOpenTab();
13  is(gBrowser.selectedTab, tabs[4], "newly opened tab is selected");
14  gBrowser.removeCurrentTab();
15  is(gBrowser.selectedTab, owner, "owner is selected");
16 
17  owner = gBrowser.selectedTab;
18  BrowserOpenTab();
19  gBrowser.selectedTab = tabs[1];
20  gBrowser.selectedTab = tabs[4];
21  gBrowser.removeCurrentTab();
22  isnot(gBrowser.selectedTab, owner, "selecting a different tab clears the owner relation");
23 
24  owner = gBrowser.selectedTab;
25  BrowserOpenTab();
26  gBrowser.moveTabTo(gBrowser.selectedTab, 0);
27  gBrowser.removeCurrentTab();
28  is(gBrowser.selectedTab, owner, "owner relatitionship persists when tab is moved");
29 
30  while (tabs.length > 1)
31  gBrowser.removeCurrentTab();
32 }
var tabs
BogusChannel prototype owner
function test()