browser/components/tabview/test/browser_tabview_bug649307.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_bug649307.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,43 @@
     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 +    registerCleanupFunction(function () {
    1.14 +      cw.gPrefBranch.clearUserPref("animate_zoom");
    1.15 +      win.close();
    1.16 +    });
    1.17 +
    1.18 +    cw.gPrefBranch.setBoolPref("animate_zoom", false);
    1.19 +
    1.20 +    let groupItem = cw.GroupItems.groupItems[0];
    1.21 +    let shield = groupItem.$titleShield[0];
    1.22 +    let keys = ["RETURN", "ESCAPE"];
    1.23 +
    1.24 +    ok(win.TabView.isVisible(), "tabview is visible");
    1.25 +
    1.26 +    let simulateKeyPress = function () {
    1.27 +      let key = keys.shift();
    1.28 +
    1.29 +      if (!key) {
    1.30 +        ok(win.TabView.isVisible(), "tabview is still visible");
    1.31 +        finish();
    1.32 +        return;
    1.33 +      }
    1.34 +
    1.35 +      EventUtils.synthesizeMouseAtCenter(shield, {}, cw);
    1.36 +      EventUtils.synthesizeKey("VK_" + key, {}, cw);
    1.37 +
    1.38 +      executeSoon(function () {
    1.39 +        ok(win.TabView.isVisible(), "tabview is still visible [" + key + "]");
    1.40 +        simulateKeyPress();
    1.41 +      });
    1.42 +    }
    1.43 +
    1.44 +    SimpleTest.waitForFocus(simulateKeyPress, cw);
    1.45 +  });
    1.46 +}

mercurial