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.
michael@0 | 1 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | http://creativecommons.org/publicdomain/zero/1.0/ */ |
michael@0 | 3 | |
michael@0 | 4 | function test() { |
michael@0 | 5 | waitForExplicitFinish(); |
michael@0 | 6 | |
michael@0 | 7 | // create two groups and each group has one tab item |
michael@0 | 8 | let newState = { |
michael@0 | 9 | windows: [{ |
michael@0 | 10 | tabs: [{ |
michael@0 | 11 | entries: [{ url: "about:robots" }], |
michael@0 | 12 | hidden: true, |
michael@0 | 13 | attributes: {}, |
michael@0 | 14 | extData: { |
michael@0 | 15 | "tabview-tab": |
michael@0 | 16 | '{"bounds":{"left":21,"top":29,"width":204,"height":153},' + |
michael@0 | 17 | '"userSize":null,"url":"about:robots","groupID":1,' + |
michael@0 | 18 | '"imageData":null,"title":null}' |
michael@0 | 19 | } |
michael@0 | 20 | },{ |
michael@0 | 21 | entries: [{ url: "about:robots" }], |
michael@0 | 22 | hidden: false, |
michael@0 | 23 | attributes: {}, |
michael@0 | 24 | extData: { |
michael@0 | 25 | "tabview-tab": |
michael@0 | 26 | '{"bounds":{"left":315,"top":29,"width":111,"height":84},' + |
michael@0 | 27 | '"userSize":null,"url":"about:robots","groupID":2,' + |
michael@0 | 28 | '"imageData":null,"title":null}' |
michael@0 | 29 | }, |
michael@0 | 30 | }], |
michael@0 | 31 | selected:2, |
michael@0 | 32 | _closedTabs: [], |
michael@0 | 33 | extData: { |
michael@0 | 34 | "tabview-groups": '{"nextID":3,"activeGroupId":2}', |
michael@0 | 35 | "tabview-group": |
michael@0 | 36 | '{"1":{"bounds":{"left":15,"top":5,"width":280,"height":232},' + |
michael@0 | 37 | '"userSize":null,"title":"","id":1},' + |
michael@0 | 38 | '"2":{"bounds":{"left":309,"top":5,"width":267,"height":226},' + |
michael@0 | 39 | '"userSize":null,"title":"","id":2}}', |
michael@0 | 40 | "tabview-ui": '{"pageBounds":{"left":0,"top":0,"width":788,"height":548}}' |
michael@0 | 41 | }, sizemode:"normal" |
michael@0 | 42 | }] |
michael@0 | 43 | }; |
michael@0 | 44 | |
michael@0 | 45 | newWindowWithState(newState, function(win) { |
michael@0 | 46 | registerCleanupFunction(function () win.close()); |
michael@0 | 47 | |
michael@0 | 48 | whenTabViewIsShown(function() { |
michael@0 | 49 | let cw = win.TabView.getContentWindow(); |
michael@0 | 50 | |
michael@0 | 51 | is(cw.GroupItems.groupItems.length, 2, "There are still two groups"); |
michael@0 | 52 | is(win.gBrowser.tabs.length, 1, "There is only one tab"); |
michael@0 | 53 | is(cw.UI.getActiveTab(), win.gBrowser.selectedTab._tabViewTabItem, "The last tab is selected"); |
michael@0 | 54 | |
michael@0 | 55 | finish(); |
michael@0 | 56 | }, win); |
michael@0 | 57 | win.gBrowser.removeTab(win.gBrowser.selectedTab); |
michael@0 | 58 | }); |
michael@0 | 59 | } |
michael@0 | 60 |