browser/components/tabview/test/browser_tabview_bug649307.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:125a9dbc9a20
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 registerCleanupFunction(function () {
11 cw.gPrefBranch.clearUserPref("animate_zoom");
12 win.close();
13 });
14
15 cw.gPrefBranch.setBoolPref("animate_zoom", false);
16
17 let groupItem = cw.GroupItems.groupItems[0];
18 let shield = groupItem.$titleShield[0];
19 let keys = ["RETURN", "ESCAPE"];
20
21 ok(win.TabView.isVisible(), "tabview is visible");
22
23 let simulateKeyPress = function () {
24 let key = keys.shift();
25
26 if (!key) {
27 ok(win.TabView.isVisible(), "tabview is still visible");
28 finish();
29 return;
30 }
31
32 EventUtils.synthesizeMouseAtCenter(shield, {}, cw);
33 EventUtils.synthesizeKey("VK_" + key, {}, cw);
34
35 executeSoon(function () {
36 ok(win.TabView.isVisible(), "tabview is still visible [" + key + "]");
37 simulateKeyPress();
38 });
39 }
40
41 SimpleTest.waitForFocus(simulateKeyPress, cw);
42 });
43 }

mercurial