browser/components/tabview/test/browser_tabview_bug665502.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:8e7542e500e2
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
3
4 function test() {
5 waitForExplicitFinish();
6
7 let onLoad = function (win) {
8 for (let i = 0; i < 2; i++)
9 win.gBrowser.addTab();
10 };
11
12 let onShow = function (win) {
13 registerCleanupFunction(function () win.close());
14
15 let cw = win.TabView.getContentWindow();
16 let groupItem = cw.GroupItems.groupItems[0];
17
18 groupItem.setSize(400, 200, true);
19
20 let tabItem = groupItem.getChild(0);
21 let bounds = tabItem.getBounds();
22
23 is(groupItem.getActiveTab(), tabItem, "the first tab is active");
24 EventUtils.synthesizeMouseAtCenter(tabItem.container, {button: 1}, cw);
25
26 is(groupItem.getChildren().indexOf(tabItem), -1, "tabItem got removed");
27 ok(bounds.equals(groupItem.getChild(0).getBounds()), "tabItem bounds didn't change");
28
29 finish();
30 };
31
32 newWindowWithTabView(onShow, onLoad);
33 }

mercurial