browser/components/tabview/test/browser_tabview_bug673729.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:21320a5b4e4e
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 newWindowWithTabView(function (win) {
8 let cw = win.TabView.getContentWindow();
9
10 // turn off zoom animations
11 cw.gPrefBranch.setBoolPref("animate_zoom", false);
12
13 registerCleanupFunction(function () {
14 cw.gPrefBranch.clearUserPref("animate_zoom");
15 win.close();
16 });
17
18 let group = cw.GroupItems.groupItems[0];
19 group.setSize(100, 100, true);
20
21 while (!group.isStacked())
22 win.gBrowser.addTab();
23
24 waitForFocus(function () {
25 whenGroupIsExpanded(group, function () {
26 ok(win.TabView.isVisible(), "tabview is visible");
27 finish();
28 });
29
30 let expander = group.$expander[0];
31 EventUtils.synthesizeMouseAtCenter(expander, {}, cw);
32 }, cw);
33 });
34 }
35
36 // ----------
37 function whenGroupIsExpanded(group, callback) {
38 group.addSubscriber("expanded", function onExpanded() {
39 group.removeSubscriber("expanded", onExpanded);
40 executeSoon(callback);
41 });
42 }

mercurial