michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: newWindowWithTabView(function (win) { michael@0: let cw = win.TabView.getContentWindow(); michael@0: michael@0: registerCleanupFunction(function () { michael@0: cw.gPrefBranch.clearUserPref("animate_zoom"); michael@0: win.close(); michael@0: }); michael@0: michael@0: cw.gPrefBranch.setBoolPref("animate_zoom", false); michael@0: michael@0: let groupItem = cw.GroupItems.groupItems[0]; michael@0: let shield = groupItem.$titleShield[0]; michael@0: let keys = ["RETURN", "ESCAPE"]; michael@0: michael@0: ok(win.TabView.isVisible(), "tabview is visible"); michael@0: michael@0: let simulateKeyPress = function () { michael@0: let key = keys.shift(); michael@0: michael@0: if (!key) { michael@0: ok(win.TabView.isVisible(), "tabview is still visible"); michael@0: finish(); michael@0: return; michael@0: } michael@0: michael@0: EventUtils.synthesizeMouseAtCenter(shield, {}, cw); michael@0: EventUtils.synthesizeKey("VK_" + key, {}, cw); michael@0: michael@0: executeSoon(function () { michael@0: ok(win.TabView.isVisible(), "tabview is still visible [" + key + "]"); michael@0: simulateKeyPress(); michael@0: }); michael@0: } michael@0: michael@0: SimpleTest.waitForFocus(simulateKeyPress, cw); michael@0: }); michael@0: }