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.

michael@0 1 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 4
michael@0 5 "use strict";
michael@0 6
michael@0 7 // Observers should be disabled when in customization mode.
michael@0 8 add_task(function() {
michael@0 9 // Open and close the panel to make sure that the
michael@0 10 // area is generated before getting a child of the area.
michael@0 11 let shownPanelPromise = promisePanelShown(window);
michael@0 12 PanelUI.toggle({type: "command"});
michael@0 13 yield shownPanelPromise;
michael@0 14 let hiddenPanelPromise = promisePanelHidden(window);
michael@0 15 PanelUI.toggle({type: "command"});
michael@0 16 yield hiddenPanelPromise;
michael@0 17
michael@0 18 let fullscreenButton = document.getElementById("fullscreen-button");
michael@0 19 ok(!fullscreenButton.checked, "Fullscreen button should not be checked when not in fullscreen.")
michael@0 20
michael@0 21 BrowserFullScreen();
michael@0 22 yield waitForCondition(function() fullscreenButton.checked);
michael@0 23 ok(fullscreenButton.checked, "Fullscreen button should be checked when in fullscreen.")
michael@0 24
michael@0 25 yield startCustomizing();
michael@0 26
michael@0 27 let fullscreenButtonWrapper = document.getElementById("wrapper-fullscreen-button");
michael@0 28 ok(fullscreenButtonWrapper.hasAttribute("itemobserves"), "Observer should be moved to wrapper");
michael@0 29 fullscreenButton = document.getElementById("fullscreen-button");
michael@0 30 ok(!fullscreenButton.hasAttribute("observes"), "Observer should be removed from button");
michael@0 31 ok(!fullscreenButton.checked, "Fullscreen button should no longer be checked during customization mode");
michael@0 32
michael@0 33 yield endCustomizing();
michael@0 34
michael@0 35 BrowserFullScreen();
michael@0 36 fullscreenButton = document.getElementById("fullscreen-button");
michael@0 37 yield waitForCondition(function() !fullscreenButton.checked);
michael@0 38 ok(!fullscreenButton.checked, "Fullscreen button should not be checked when not in fullscreen.")
michael@0 39 });

mercurial