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 | newWindowWithTabView(testTopOfStack, loadTabs); |
michael@0 | 7 | } |
michael@0 | 8 | |
michael@0 | 9 | function loadTabs (win) { |
michael@0 | 10 | for (let i = 0; i < 4; i++) |
michael@0 | 11 | win.gBrowser.loadOneTab('about:blank', {inBackground: false}); |
michael@0 | 12 | win.gBrowser.selectedTab = win.gBrowser.tabs[2]; |
michael@0 | 13 | } |
michael@0 | 14 | |
michael@0 | 15 | function testTopOfStack(win) { |
michael@0 | 16 | registerCleanupFunction(function () { win.close(); }); |
michael@0 | 17 | let cw = win.TabView.getContentWindow(); |
michael@0 | 18 | let groupItem = cw.GroupItems.getActiveGroupItem(); |
michael@0 | 19 | ok(!groupItem.isStacked(), 'groupItem is not stacked'); |
michael@0 | 20 | groupItem.setSize(150, 150); |
michael@0 | 21 | groupItem.setUserSize(); |
michael@0 | 22 | ok(groupItem.isStacked(), 'groupItem is now stacked'); |
michael@0 | 23 | ok(groupItem.isTopOfStack(groupItem.getChild(2)), |
michael@0 | 24 | 'the third tab is on top of stack'); |
michael@0 | 25 | finish(); |
michael@0 | 26 | } |
michael@0 | 27 |