1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/components/tabview/test/browser_tabview_bug633788.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,31 @@ 1.4 +/* Any copyright is dedicated to the Public Domain. 1.5 + http://creativecommons.org/publicdomain/zero/1.0/ */ 1.6 + 1.7 +function test() { 1.8 + waitForExplicitFinish(); 1.9 + 1.10 + newWindowWithTabView(win => { 1.11 + is(win.gBrowser.tabs.length, 1, "There is only one tab"); 1.12 + 1.13 + let tab = win.gBrowser.tabs[0]; 1.14 + let tabItem = tab._tabViewTabItem; 1.15 + ok(tabItem.parent, "The tab item belongs to a group"); 1.16 + let groupId = tabItem.parent.id; 1.17 + 1.18 + tab._tabViewTabItem.close(); 1.19 + 1.20 + whenTabViewIsHidden(function() { 1.21 + // a new tab with group should be opened 1.22 + is(win.gBrowser.tabs.length, 1, "There is still one tab"); 1.23 + isnot(win.gBrowser.selectedTab, tab, "The tab is different"); 1.24 + 1.25 + tab = win.gBrowser.tabs[0]; 1.26 + tabItem = tab._tabViewTabItem; 1.27 + ok(tabItem.parent, "This new tab item belongs to a group"); 1.28 + 1.29 + is(tabItem.parent.id, groupId, "The group is different"); 1.30 + 1.31 + promiseWindowClosed(win).then(finish); 1.32 + }, win); 1.33 + }); 1.34 +}