browser/components/tabview/test/browser_tabview_bug673729.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/components/tabview/test/browser_tabview_bug673729.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,42 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 +   http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +function test() {
     1.8 +  waitForExplicitFinish();
     1.9 +
    1.10 +  newWindowWithTabView(function (win) {
    1.11 +    let cw = win.TabView.getContentWindow();
    1.12 +
    1.13 +    // turn off zoom animations
    1.14 +    cw.gPrefBranch.setBoolPref("animate_zoom", false);
    1.15 +
    1.16 +    registerCleanupFunction(function () {
    1.17 +      cw.gPrefBranch.clearUserPref("animate_zoom");
    1.18 +      win.close();
    1.19 +    });
    1.20 +
    1.21 +    let group = cw.GroupItems.groupItems[0];
    1.22 +    group.setSize(100, 100, true);
    1.23 +
    1.24 +    while (!group.isStacked())
    1.25 +      win.gBrowser.addTab();
    1.26 +
    1.27 +    waitForFocus(function () {
    1.28 +      whenGroupIsExpanded(group, function () {
    1.29 +        ok(win.TabView.isVisible(), "tabview is visible");
    1.30 +        finish();
    1.31 +      });
    1.32 +
    1.33 +      let expander = group.$expander[0];
    1.34 +      EventUtils.synthesizeMouseAtCenter(expander, {}, cw);
    1.35 +    }, cw);
    1.36 +  });
    1.37 +}
    1.38 +
    1.39 +// ----------
    1.40 +function whenGroupIsExpanded(group, callback) {
    1.41 +  group.addSubscriber("expanded", function onExpanded() {
    1.42 +    group.removeSubscriber("expanded", onExpanded);
    1.43 +    executeSoon(callback);
    1.44 +  });
    1.45 +}

mercurial