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