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 | newWindowWithTabView(function (win) { |
michael@0 | 8 | let cw = win.TabView.getContentWindow(); |
michael@0 | 9 | |
michael@0 | 10 | // turn off zoom animations |
michael@0 | 11 | cw.gPrefBranch.setBoolPref("animate_zoom", false); |
michael@0 | 12 | |
michael@0 | 13 | registerCleanupFunction(function () { |
michael@0 | 14 | cw.gPrefBranch.clearUserPref("animate_zoom"); |
michael@0 | 15 | win.close(); |
michael@0 | 16 | }); |
michael@0 | 17 | |
michael@0 | 18 | let group = cw.GroupItems.groupItems[0]; |
michael@0 | 19 | group.setSize(100, 100, true); |
michael@0 | 20 | |
michael@0 | 21 | while (!group.isStacked()) |
michael@0 | 22 | win.gBrowser.addTab(); |
michael@0 | 23 | |
michael@0 | 24 | waitForFocus(function () { |
michael@0 | 25 | whenGroupIsExpanded(group, function () { |
michael@0 | 26 | ok(win.TabView.isVisible(), "tabview is visible"); |
michael@0 | 27 | finish(); |
michael@0 | 28 | }); |
michael@0 | 29 | |
michael@0 | 30 | let expander = group.$expander[0]; |
michael@0 | 31 | EventUtils.synthesizeMouseAtCenter(expander, {}, cw); |
michael@0 | 32 | }, cw); |
michael@0 | 33 | }); |
michael@0 | 34 | } |
michael@0 | 35 | |
michael@0 | 36 | // ---------- |
michael@0 | 37 | function whenGroupIsExpanded(group, callback) { |
michael@0 | 38 | group.addSubscriber("expanded", function onExpanded() { |
michael@0 | 39 | group.removeSubscriber("expanded", onExpanded); |
michael@0 | 40 | executeSoon(callback); |
michael@0 | 41 | }); |
michael@0 | 42 | } |