browser/base/content/test/general/browser_bug563588.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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 }

mercurial