browser/components/tabview/test/browser_tabview_bug665502.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   waitForExplicitFinish();
     7   let onLoad = function (win) {
     8     for (let i = 0; i < 2; i++)
     9       win.gBrowser.addTab();
    10   };
    12   let onShow = function (win) {
    13     registerCleanupFunction(function () win.close());
    15     let cw = win.TabView.getContentWindow();
    16     let groupItem = cw.GroupItems.groupItems[0];
    18     groupItem.setSize(400, 200, true);
    20     let tabItem = groupItem.getChild(0);
    21     let bounds = tabItem.getBounds();
    23     is(groupItem.getActiveTab(), tabItem, "the first tab is active");
    24     EventUtils.synthesizeMouseAtCenter(tabItem.container, {button: 1}, cw);
    26     is(groupItem.getChildren().indexOf(tabItem), -1, "tabItem got removed");
    27     ok(bounds.equals(groupItem.getChild(0).getBounds()), "tabItem bounds didn't change");
    29     finish();
    30   };
    32   newWindowWithTabView(onShow, onLoad);
    33 }

mercurial