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 | function onLoad(win) { |
michael@0 | 6 | registerCleanupFunction(function () win.close()); |
michael@0 | 7 | win.gBrowser.addTab(); |
michael@0 | 8 | } |
michael@0 | 9 | |
michael@0 | 10 | function onShow(win) { |
michael@0 | 11 | let cw = win.TabView.getContentWindow(); |
michael@0 | 12 | let group = cw.GroupItems.groupItems[0]; |
michael@0 | 13 | |
michael@0 | 14 | // shrink the group to make some room for dragging |
michael@0 | 15 | group.setSize(200, 200, true); |
michael@0 | 16 | |
michael@0 | 17 | waitForFocus(function () { |
michael@0 | 18 | let target = group.getChild(0).container; |
michael@0 | 19 | EventUtils.synthesizeMouseAtCenter(target, {type: "mousedown"}, cw); |
michael@0 | 20 | EventUtils.synthesizeMouse(target, 0, 300, {type: "mousemove"}, cw); |
michael@0 | 21 | EventUtils.synthesizeMouseAtCenter(target, {type: "mouseup"}, cw); |
michael@0 | 22 | |
michael@0 | 23 | let newGroup = cw.GroupItems.groupItems[1]; |
michael@0 | 24 | let groupBounds = newGroup.getBounds(); |
michael@0 | 25 | |
michael@0 | 26 | let safeWindowBounds = cw.Items.getSafeWindowBounds(); |
michael@0 | 27 | ok(safeWindowBounds.contains(groupBounds), |
michael@0 | 28 | "new group is within safe window bounds"); |
michael@0 | 29 | |
michael@0 | 30 | finish(); |
michael@0 | 31 | }, cw); |
michael@0 | 32 | } |
michael@0 | 33 | |
michael@0 | 34 | waitForExplicitFinish(); |
michael@0 | 35 | newWindowWithTabView(onShow, onLoad); |
michael@0 | 36 | } |