mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 06:45:42 +00:00
Test for bug 563588
This commit is contained in:
parent
1523dc5451
commit
f212588bd1
@ -119,6 +119,7 @@ _BROWSER_FILES = \
|
||||
browser_bug537474.js \
|
||||
browser_bug550565.js \
|
||||
browser_bug555224.js \
|
||||
browser_bug563588.js \
|
||||
browser_contextSearchTabPosition.js \
|
||||
browser_ctrlTab.js \
|
||||
browser_discovery.js \
|
||||
|
30
browser/base/content/test/browser_bug563588.js
Normal file
30
browser/base/content/test/browser_bug563588.js
Normal file
@ -0,0 +1,30 @@
|
||||
function press(key, expectedPos) {
|
||||
var originalSelectedTab = gBrowser.selectedTab;
|
||||
EventUtils.synthesizeKey("VK_" + key.toUpperCase(), { accelKey: true });
|
||||
is(gBrowser.selectedTab, originalSelectedTab,
|
||||
"accel+" + key + " doesn't change which tab is selected");
|
||||
is(gBrowser.tabContainer.selectedIndex, expectedPos,
|
||||
"accel+" + key + " moves the tab to the expected position");
|
||||
is(document.activeElement, gBrowser.selectedTab,
|
||||
"accel+" + key + " leaves the selected tab focused");
|
||||
}
|
||||
|
||||
function test() {
|
||||
gBrowser.addTab();
|
||||
gBrowser.addTab();
|
||||
is(gBrowser.tabs.length, 3, "got three tabs");
|
||||
is(gBrowser.tabs[0], gBrowser.selectedTab, "first tab is selected");
|
||||
|
||||
gBrowser.selectedTab.focus();
|
||||
is(document.activeElement, gBrowser.selectedTab, "selected tab is focused");
|
||||
|
||||
press("right", 1);
|
||||
press("down", 2);
|
||||
press("left", 1);
|
||||
press("up", 0);
|
||||
press("end", 2);
|
||||
press("home", 0);
|
||||
|
||||
gBrowser.removeCurrentTab();
|
||||
gBrowser.removeCurrentTab();
|
||||
}
|
Loading…
Reference in New Issue
Block a user