browser/components/tabview/test/browser_tabview_bug649307.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 function test() {
     5   waitForExplicitFinish();
     7   newWindowWithTabView(function (win) {
     8     let cw = win.TabView.getContentWindow();
    10     registerCleanupFunction(function () {
    11       cw.gPrefBranch.clearUserPref("animate_zoom");
    12       win.close();
    13     });
    15     cw.gPrefBranch.setBoolPref("animate_zoom", false);
    17     let groupItem = cw.GroupItems.groupItems[0];
    18     let shield = groupItem.$titleShield[0];
    19     let keys = ["RETURN", "ESCAPE"];
    21     ok(win.TabView.isVisible(), "tabview is visible");
    23     let simulateKeyPress = function () {
    24       let key = keys.shift();
    26       if (!key) {
    27         ok(win.TabView.isVisible(), "tabview is still visible");
    28         finish();
    29         return;
    30       }
    32       EventUtils.synthesizeMouseAtCenter(shield, {}, cw);
    33       EventUtils.synthesizeKey("VK_" + key, {}, cw);
    35       executeSoon(function () {
    36         ok(win.TabView.isVisible(), "tabview is still visible [" + key + "]");
    37         simulateKeyPress();
    38       });
    39     }
    41     SimpleTest.waitForFocus(simulateKeyPress, cw);
    42   });
    43 }

mercurial