michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: "use strict"; michael@0: michael@0: // Observers should be disabled when in customization mode. michael@0: add_task(function() { michael@0: // Open and close the panel to make sure that the michael@0: // area is generated before getting a child of the area. michael@0: let shownPanelPromise = promisePanelShown(window); michael@0: PanelUI.toggle({type: "command"}); michael@0: yield shownPanelPromise; michael@0: let hiddenPanelPromise = promisePanelHidden(window); michael@0: PanelUI.toggle({type: "command"}); michael@0: yield hiddenPanelPromise; michael@0: michael@0: let fullscreenButton = document.getElementById("fullscreen-button"); michael@0: ok(!fullscreenButton.checked, "Fullscreen button should not be checked when not in fullscreen.") michael@0: michael@0: BrowserFullScreen(); michael@0: yield waitForCondition(function() fullscreenButton.checked); michael@0: ok(fullscreenButton.checked, "Fullscreen button should be checked when in fullscreen.") michael@0: michael@0: yield startCustomizing(); michael@0: michael@0: let fullscreenButtonWrapper = document.getElementById("wrapper-fullscreen-button"); michael@0: ok(fullscreenButtonWrapper.hasAttribute("itemobserves"), "Observer should be moved to wrapper"); michael@0: fullscreenButton = document.getElementById("fullscreen-button"); michael@0: ok(!fullscreenButton.hasAttribute("observes"), "Observer should be removed from button"); michael@0: ok(!fullscreenButton.checked, "Fullscreen button should no longer be checked during customization mode"); michael@0: michael@0: yield endCustomizing(); michael@0: michael@0: BrowserFullScreen(); michael@0: fullscreenButton = document.getElementById("fullscreen-button"); michael@0: yield waitForCondition(function() !fullscreenButton.checked); michael@0: ok(!fullscreenButton.checked, "Fullscreen button should not be checked when not in fullscreen.") michael@0: });