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 | let state = { |
michael@0 | 5 | windows: [{ |
michael@0 | 6 | tabs: [{ |
michael@0 | 7 | entries: [{ url: "about:robots" }], |
michael@0 | 8 | hidden: true, |
michael@0 | 9 | extData: {"tabview-tab": '{"url":"about:robots","groupID":1,"bounds":{"left":120,"top":20,"width":20,"height":20}}'} |
michael@0 | 10 | },{ |
michael@0 | 11 | entries: [{ url: "about:robots" }], |
michael@0 | 12 | hidden: false, |
michael@0 | 13 | extData: {"tabview-tab": '{"url":"about:robots","groupID":2,"bounds":{"left":20,"top":20,"width":20,"height":20}}'}, |
michael@0 | 14 | }], |
michael@0 | 15 | selected: 2, |
michael@0 | 16 | extData: { |
michael@0 | 17 | "tabview-groups": '{"nextID":3,"activeGroupId":2, "totalNumber":2}', |
michael@0 | 18 | "tabview-group": |
michael@0 | 19 | '{"1":{"bounds":{"left":15,"top":5,"width":280,"height":232},"id":1},' + |
michael@0 | 20 | '"2":{"bounds":{"left":309,"top":5,"width":267,"height":226},"id":2}}' |
michael@0 | 21 | } |
michael@0 | 22 | }] |
michael@0 | 23 | }; |
michael@0 | 24 | |
michael@0 | 25 | function test() { |
michael@0 | 26 | waitForExplicitFinish(); |
michael@0 | 27 | |
michael@0 | 28 | newWindowWithState(state, function(win) { |
michael@0 | 29 | registerCleanupFunction(function() win.close()); |
michael@0 | 30 | |
michael@0 | 31 | win.gBrowser.addTab(); |
michael@0 | 32 | |
michael@0 | 33 | ok(win.gBrowser.tabs[0].hidden, "The first tab is hidden"); |
michael@0 | 34 | win.gBrowser.selectedTab = win.gBrowser.tabs[0]; |
michael@0 | 35 | |
michael@0 | 36 | function onTabViewFrameInitialized() { |
michael@0 | 37 | win.removeEventListener( |
michael@0 | 38 | "tabviewframeinitialized", onTabViewFrameInitialized, false); |
michael@0 | 39 | |
michael@0 | 40 | let cw = win.TabView.getContentWindow(); |
michael@0 | 41 | is(cw.GroupItems.groupItem(1).getChild(0).tab, win.gBrowser.selectedTab, "The tab in group one matches the selected tab"); |
michael@0 | 42 | is(cw.GroupItems.groupItem(1).getChildren().length, 1, "The group one has only one tab item"); |
michael@0 | 43 | is(cw.GroupItems.groupItem(2).getChildren().length, 2, "The group one has only two tab item") |
michael@0 | 44 | |
michael@0 | 45 | finish(); |
michael@0 | 46 | } |
michael@0 | 47 | win.addEventListener( |
michael@0 | 48 | "tabviewframeinitialized", onTabViewFrameInitialized, false); |
michael@0 | 49 | }); |
michael@0 | 50 | } |
michael@0 | 51 |