1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/components/tabview/test/browser_tabview_bug707466.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,60 @@ 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 + // create two groups and each group has one tab item 1.11 + let newState = { 1.12 + windows: [{ 1.13 + tabs: [{ 1.14 + entries: [{ url: "about:robots" }], 1.15 + hidden: true, 1.16 + attributes: {}, 1.17 + extData: { 1.18 + "tabview-tab": 1.19 + '{"bounds":{"left":21,"top":29,"width":204,"height":153},' + 1.20 + '"userSize":null,"url":"about:robots","groupID":1,' + 1.21 + '"imageData":null,"title":null}' 1.22 + } 1.23 + },{ 1.24 + entries: [{ url: "about:robots" }], 1.25 + hidden: false, 1.26 + attributes: {}, 1.27 + extData: { 1.28 + "tabview-tab": 1.29 + '{"bounds":{"left":315,"top":29,"width":111,"height":84},' + 1.30 + '"userSize":null,"url":"about:robots","groupID":2,' + 1.31 + '"imageData":null,"title":null}' 1.32 + }, 1.33 + }], 1.34 + selected:2, 1.35 + _closedTabs: [], 1.36 + extData: { 1.37 + "tabview-groups": '{"nextID":3,"activeGroupId":2}', 1.38 + "tabview-group": 1.39 + '{"1":{"bounds":{"left":15,"top":5,"width":280,"height":232},' + 1.40 + '"userSize":null,"title":"","id":1},' + 1.41 + '"2":{"bounds":{"left":309,"top":5,"width":267,"height":226},' + 1.42 + '"userSize":null,"title":"","id":2}}', 1.43 + "tabview-ui": '{"pageBounds":{"left":0,"top":0,"width":788,"height":548}}' 1.44 + }, sizemode:"normal" 1.45 + }] 1.46 + }; 1.47 + 1.48 + newWindowWithState(newState, function(win) { 1.49 + registerCleanupFunction(function () win.close()); 1.50 + 1.51 + whenTabViewIsShown(function() { 1.52 + let cw = win.TabView.getContentWindow(); 1.53 + 1.54 + is(cw.GroupItems.groupItems.length, 2, "There are still two groups"); 1.55 + is(win.gBrowser.tabs.length, 1, "There is only one tab"); 1.56 + is(cw.UI.getActiveTab(), win.gBrowser.selectedTab._tabViewTabItem, "The last tab is selected"); 1.57 + 1.58 + finish(); 1.59 + }, win); 1.60 + win.gBrowser.removeTab(win.gBrowser.selectedTab); 1.61 + }); 1.62 +} 1.63 +