Thu, 22 Jan 2015 13:21:57 +0100
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 }