browser/components/tabview/test/browser_tabview_bug662266.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.

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 waitForExplicitFinish();
michael@0 6
michael@0 7 newWindowWithTabView(function (win) {
michael@0 8 registerCleanupFunction(function () win.close());
michael@0 9
michael@0 10 for (let i = 0; i < 4; i++)
michael@0 11 win.gBrowser.loadOneTab("about:blank", {inBackground: true});
michael@0 12
michael@0 13 let cw = win.TabView.getContentWindow();
michael@0 14 let groupItem = cw.GroupItems.groupItems[0];
michael@0 15 let children = groupItem.getChildren();
michael@0 16
michael@0 17 groupItem.setSize(200, 200, true);
michael@0 18 ok(groupItem.isStacked(), "groupItem is now stacked");
michael@0 19 is(win.gBrowser.tabs.length, 5, "we have five tabs");
michael@0 20
michael@0 21 groupItem.addSubscriber("expanded", function onExpanded() {
michael@0 22 groupItem.removeSubscriber("expanded", onExpanded);
michael@0 23
michael@0 24 ok(groupItem.expanded, "groupItem is expanded");
michael@0 25 let bounds = children[1].getBounds();
michael@0 26
michael@0 27 // remove two tabs and see if the remaining tabs are re-arranged to fill
michael@0 28 // the resulting gaps
michael@0 29 for (let i = 0; i < 2; i++) {
michael@0 30 EventUtils.synthesizeMouseAtCenter(children[1].container, {button: 1}, cw);
michael@0 31 ok(bounds.equals(children[1].getBounds()), "tabItems were re-arranged");
michael@0 32 }
michael@0 33
michael@0 34 waitForFocus(finish);
michael@0 35 });
michael@0 36
michael@0 37 groupItem.expand();
michael@0 38 });
michael@0 39 }

mercurial