browser/components/customizableui/test/browser_885052_customize_mode_observers_disabed.js

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

     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 // Observers should be disabled when in customization mode.
     8 add_task(function() {
     9   // Open and close the panel to make sure that the
    10   // area is generated before getting a child of the area.
    11   let shownPanelPromise = promisePanelShown(window);
    12   PanelUI.toggle({type: "command"});
    13   yield shownPanelPromise;
    14   let hiddenPanelPromise = promisePanelHidden(window);
    15   PanelUI.toggle({type: "command"});
    16   yield hiddenPanelPromise;
    18   let fullscreenButton = document.getElementById("fullscreen-button");
    19   ok(!fullscreenButton.checked, "Fullscreen button should not be checked when not in fullscreen.")
    21   BrowserFullScreen();
    22   yield waitForCondition(function() fullscreenButton.checked);
    23   ok(fullscreenButton.checked, "Fullscreen button should be checked when in fullscreen.")
    25   yield startCustomizing();
    27   let fullscreenButtonWrapper = document.getElementById("wrapper-fullscreen-button");
    28   ok(fullscreenButtonWrapper.hasAttribute("itemobserves"), "Observer should be moved to wrapper");
    29   fullscreenButton = document.getElementById("fullscreen-button");
    30   ok(!fullscreenButton.hasAttribute("observes"), "Observer should be removed from button");
    31   ok(!fullscreenButton.checked, "Fullscreen button should no longer be checked during customization mode");
    33   yield endCustomizing();
    35   BrowserFullScreen();
    36   fullscreenButton = document.getElementById("fullscreen-button");
    37   yield waitForCondition(function() !fullscreenButton.checked);
    38   ok(!fullscreenButton.checked, "Fullscreen button should not be checked when not in fullscreen.")
    39 });

mercurial