browser/components/tabview/test/browser_tabview_bug673196.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 function test() {
     5   function onLoad(win) {
     6     registerCleanupFunction(function () win.close());
     7     win.gBrowser.addTab();
     8   }
    10   function onShow(win) {
    11     let cw = win.TabView.getContentWindow();
    12     let group = cw.GroupItems.groupItems[0];
    14     // shrink the group to make some room for dragging
    15     group.setSize(200, 200, true);
    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);
    23       let newGroup = cw.GroupItems.groupItems[1];
    24       let groupBounds = newGroup.getBounds();
    26       let safeWindowBounds = cw.Items.getSafeWindowBounds();
    27       ok(safeWindowBounds.contains(groupBounds),
    28          "new group is within safe window bounds");
    30       finish();
    31     }, cw);
    32   }
    34   waitForExplicitFinish();
    35   newWindowWithTabView(onShow, onLoad);
    36 }

mercurial