Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 function press(key, expectedPos) {
2 var originalSelectedTab = gBrowser.selectedTab;
3 EventUtils.synthesizeKey("VK_" + key.toUpperCase(), { accelKey: true });
4 is(gBrowser.selectedTab, originalSelectedTab,
5 "accel+" + key + " doesn't change which tab is selected");
6 is(gBrowser.tabContainer.selectedIndex, expectedPos,
7 "accel+" + key + " moves the tab to the expected position");
8 is(document.activeElement, gBrowser.selectedTab,
9 "accel+" + key + " leaves the selected tab focused");
10 }
12 function test() {
13 gBrowser.addTab();
14 gBrowser.addTab();
15 is(gBrowser.tabs.length, 3, "got three tabs");
16 is(gBrowser.tabs[0], gBrowser.selectedTab, "first tab is selected");
18 gBrowser.selectedTab.focus();
19 is(document.activeElement, gBrowser.selectedTab, "selected tab is focused");
21 press("right", 1);
22 press("down", 2);
23 press("left", 1);
24 press("up", 0);
25 press("end", 2);
26 press("home", 0);
28 gBrowser.removeCurrentTab();
29 gBrowser.removeCurrentTab();
30 }