browser/components/tabview/test/browser_tabview_bug673196.js

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

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 }

mercurial