|
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 compareCanvasSize = function (prefix, width, height, tabItem) { |
|
8 let canvas = tabItem.$canvas[0]; |
|
9 is(canvas.width, width, prefix + ": canvas widths are equal (" + width + "px)"); |
|
10 is(canvas.height, height, prefix + ": canvas heights are equal (" + height + "px)"); |
|
11 }; |
|
12 |
|
13 newWindowWithTabView(function (win) { |
|
14 registerCleanupFunction(function () win.close()); |
|
15 |
|
16 let cw = win.TabView.getContentWindow(); |
|
17 let groupItem = cw.GroupItems.groupItems[0]; |
|
18 let tabItem = groupItem.getChild(0); |
|
19 |
|
20 afterAllTabItemsUpdated(function () { |
|
21 let {width, height} = tabItem.$canvas[0]; |
|
22 |
|
23 hideGroupItem(groupItem, function () { |
|
24 compareCanvasSize("hidden", width, height, tabItem); |
|
25 |
|
26 unhideGroupItem(groupItem, function () { |
|
27 compareCanvasSize("unhidden", width, height, tabItem); |
|
28 finish(); |
|
29 }); |
|
30 }); |
|
31 }, win); |
|
32 }); |
|
33 } |