browser/components/customizableui/test/browser_panel_toggle.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 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 "use strict";
     7 /**
     8  * Test opening and closing the menu panel UI.
     9  */
    11 // Show and hide the menu panel programmatically without an event (like UITour.jsm would)
    12 add_task(function() {
    13   let shownPromise = promisePanelShown(window);
    14   PanelUI.show();
    15   yield shownPromise;
    17   is(PanelUI.panel.getAttribute("panelopen"), "true", "Check that panel has panelopen attribute");
    18   is(PanelUI.panel.state, "open", "Check that panel state is 'open'");
    20   let hiddenPromise = promisePanelHidden(window);
    21   PanelUI.hide();
    22   yield hiddenPromise;
    24   ok(!PanelUI.panel.hasAttribute("panelopen"), "Check that panel doesn't have the panelopen attribute");
    25   is(PanelUI.panel.state, "closed", "Check that panel state is 'closed'");
    26 });
    28 // Toggle the menu panel open and closed
    29 add_task(function() {
    30   let shownPromise = promisePanelShown(window);
    31   PanelUI.toggle({type: "command"});
    32   yield shownPromise;
    34   is(PanelUI.panel.getAttribute("panelopen"), "true", "Check that panel has panelopen attribute");
    35   is(PanelUI.panel.state, "open", "Check that panel state is 'open'");
    37   let hiddenPromise = promisePanelHidden(window);
    38   PanelUI.toggle({type: "command"});
    39   yield hiddenPromise;
    41   ok(!PanelUI.panel.hasAttribute("panelopen"), "Check that panel doesn't have the panelopen attribute");
    42   is(PanelUI.panel.state, "closed", "Check that panel state is 'closed'");
    43 });

mercurial