michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: function test() { michael@0: function onLoad(win) { michael@0: registerCleanupFunction(function () win.close()); michael@0: win.gBrowser.addTab(); michael@0: } michael@0: michael@0: function onShow(win) { michael@0: let cw = win.TabView.getContentWindow(); michael@0: let group = cw.GroupItems.groupItems[0]; michael@0: michael@0: // shrink the group to make some room for dragging michael@0: group.setSize(200, 200, true); michael@0: michael@0: waitForFocus(function () { michael@0: let target = group.getChild(0).container; michael@0: EventUtils.synthesizeMouseAtCenter(target, {type: "mousedown"}, cw); michael@0: EventUtils.synthesizeMouse(target, 0, 300, {type: "mousemove"}, cw); michael@0: EventUtils.synthesizeMouseAtCenter(target, {type: "mouseup"}, cw); michael@0: michael@0: let newGroup = cw.GroupItems.groupItems[1]; michael@0: let groupBounds = newGroup.getBounds(); michael@0: michael@0: let safeWindowBounds = cw.Items.getSafeWindowBounds(); michael@0: ok(safeWindowBounds.contains(groupBounds), michael@0: "new group is within safe window bounds"); michael@0: michael@0: finish(); michael@0: }, cw); michael@0: } michael@0: michael@0: waitForExplicitFinish(); michael@0: newWindowWithTabView(onShow, onLoad); michael@0: }