browser/components/tabview/test/browser_tabview_bug628887.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     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     registerCleanupFunction(function() win.close());
    10     let cw = win.TabView.getContentWindow();
    11     let groupItemOne = cw.GroupItems.groupItems[0];
    13     let groupItemTwo = createGroupItemWithBlankTabs(win, 100, 100, 40, 2);
    14     ok(groupItemTwo.isStacked(), "groupItem is now stacked");
    16     is(win.gBrowser.tabs.length, 3, "There are three tabs");
    18     // the focus should remain within the group after it's expanded
    19     groupItemTwo.addSubscriber("expanded", function onExpanded() {
    20       groupItemTwo.removeSubscriber("expanded", onExpanded);
    22       ok(groupItemTwo.expanded, "groupItemTwo is expanded");
    23       is(cw.UI.getActiveTab(), groupItemTwo.getChild(0),
    24          "The first tab item in group item two is active in expanded mode");
    26       EventUtils.synthesizeKey("VK_DOWN", {}, cw);
    27       is(cw.UI.getActiveTab(), groupItemTwo.getChild(0),
    28          "The first tab item is still active after pressing down key");
    30       // the focus should goes to other group if the down arrow is pressed
    31       groupItemTwo.addSubscriber("collapsed", function onExpanded() {
    32         groupItemTwo.removeSubscriber("collapsed", onExpanded);
    34         ok(!groupItemTwo.expanded, "groupItemTwo is not expanded");
    35         is(cw.UI.getActiveTab(), groupItemTwo.getChild(0),
    36            "The first tab item is active in group item two in collapsed mode");
    38         EventUtils.synthesizeKey("VK_DOWN", {}, cw);
    39         is(cw.UI.getActiveTab(), groupItemOne.getChild(0),
    40            "The first tab item in group item one is active after pressing down key");
    42         finish();
    43       });
    45       groupItemTwo.collapse();
    46     });
    48     groupItemTwo.expand();
    49   });
    50 }

mercurial