Thu, 15 Jan 2015 15:55:04 +0100
Back out 97036ab72558 which inappropriately compared turds to third parties.
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
4 function test() {
5 let cw;
6 let win;
8 waitForExplicitFinish();
10 newWindowWithTabView(function (tvwin) {
11 win = tvwin;
12 cw = win.TabView.getContentWindow();
14 registerCleanupFunction(function () {
15 if (win && !win.closed)
16 win.close();
17 });
19 // fill the group item with some tabs
20 for (let i = 0; i < 5; i++)
21 win.gBrowser.loadOneTab("about:blank");
23 let groupItem = cw.GroupItems.groupItems[0];
24 groupItem.setSize(400, 400, true);
25 let range = new cw.Range(1, 400);
27 // determine the groupItem's largest possible stacked size
28 while (range.extent > 1) {
29 let pivot = Math.floor(range.extent / 2);
30 groupItem.setSize(range.min + pivot, range.min + pivot, true);
32 if (groupItem.isStacked())
33 range.min += pivot;
34 else
35 range.max -= pivot;
36 }
38 // stack the group
39 groupItem.setSize(range.min, range.min, true);
40 ok(groupItem.isStacked(), "groupItem is stacked");
42 // one step back to un-stack the groupItem
43 groupItem.setSize(range.max, range.max, true);
44 ok(!groupItem.isStacked(), "groupItem is no longer stacked");
46 // check that close buttons are visible
47 let tabItem = groupItem.getChild(0);
48 isnot(tabItem.$close.css("display"), "none", "close button is visible");
50 finish();
51 });
52 }