1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/components/customizableui/test/browser_885052_customize_mode_observers_disabed.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,39 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +"use strict"; 1.9 + 1.10 +// Observers should be disabled when in customization mode. 1.11 +add_task(function() { 1.12 + // Open and close the panel to make sure that the 1.13 + // area is generated before getting a child of the area. 1.14 + let shownPanelPromise = promisePanelShown(window); 1.15 + PanelUI.toggle({type: "command"}); 1.16 + yield shownPanelPromise; 1.17 + let hiddenPanelPromise = promisePanelHidden(window); 1.18 + PanelUI.toggle({type: "command"}); 1.19 + yield hiddenPanelPromise; 1.20 + 1.21 + let fullscreenButton = document.getElementById("fullscreen-button"); 1.22 + ok(!fullscreenButton.checked, "Fullscreen button should not be checked when not in fullscreen.") 1.23 + 1.24 + BrowserFullScreen(); 1.25 + yield waitForCondition(function() fullscreenButton.checked); 1.26 + ok(fullscreenButton.checked, "Fullscreen button should be checked when in fullscreen.") 1.27 + 1.28 + yield startCustomizing(); 1.29 + 1.30 + let fullscreenButtonWrapper = document.getElementById("wrapper-fullscreen-button"); 1.31 + ok(fullscreenButtonWrapper.hasAttribute("itemobserves"), "Observer should be moved to wrapper"); 1.32 + fullscreenButton = document.getElementById("fullscreen-button"); 1.33 + ok(!fullscreenButton.hasAttribute("observes"), "Observer should be removed from button"); 1.34 + ok(!fullscreenButton.checked, "Fullscreen button should no longer be checked during customization mode"); 1.35 + 1.36 + yield endCustomizing(); 1.37 + 1.38 + BrowserFullScreen(); 1.39 + fullscreenButton = document.getElementById("fullscreen-button"); 1.40 + yield waitForCondition(function() !fullscreenButton.checked); 1.41 + ok(!fullscreenButton.checked, "Fullscreen button should not be checked when not in fullscreen.") 1.42 +});