browser/components/customizableui/test/browser_885052_customize_mode_observers_disabed.js

branch
TOR_BUG_3246
changeset 6
8bccb770b82d
equal deleted inserted replaced
-1:000000000000 0:df482080df06
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/. */
4
5 "use strict";
6
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;
17
18 let fullscreenButton = document.getElementById("fullscreen-button");
19 ok(!fullscreenButton.checked, "Fullscreen button should not be checked when not in fullscreen.")
20
21 BrowserFullScreen();
22 yield waitForCondition(function() fullscreenButton.checked);
23 ok(fullscreenButton.checked, "Fullscreen button should be checked when in fullscreen.")
24
25 yield startCustomizing();
26
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");
32
33 yield endCustomizing();
34
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