browser/components/tabview/test/browser_tabview_bug649307.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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