Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 885052 - Fullscreen-button is checked during customization mode i…
…f the browser is in fullscreen. r=Unfocused
  • Loading branch information
msujaws committed Dec 17, 2013
1 parent 1f4e3db commit 8424078
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
9 changes: 9 additions & 0 deletions browser/components/customizableui/src/CustomizeMode.jsm
Expand Up @@ -527,6 +527,11 @@ CustomizeMode.prototype = {
aNode.removeAttribute("command");
}

if (aNode.hasAttribute("observes")) {
wrapper.setAttribute("itemobserves", aNode.getAttribute("observes"));
aNode.removeAttribute("observes");
}

if (aNode.checked) {
wrapper.setAttribute("itemchecked", "true");
aNode.checked = false;
Expand Down Expand Up @@ -602,6 +607,10 @@ CustomizeMode.prototype = {
return null;
}

if (aWrapper.hasAttribute("itemobserves")) {
toolbarItem.setAttribute("observes", aWrapper.getAttribute("itemobserves"));
}

if (aWrapper.hasAttribute("itemchecked")) {
toolbarItem.checked = true;
}
Expand Down
1 change: 1 addition & 0 deletions browser/components/customizableui/test/browser.ini
Expand Up @@ -11,6 +11,7 @@ support-files =
[browser_878452_drag_to_panel.js]
[browser_880164_customization_context_menus.js]
[browser_880382_drag_wide_widgets_in_panel.js]
[browser_885052_customize_mode_observers_disabed.js]
[browser_885530_showInPrivateBrowsing.js]
[browser_886323_buildArea_removable_nodes.js]
[browser_887438_currentset_shim.js]
Expand Down
@@ -0,0 +1,37 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

"use strict";

// Observers should be disabled when in customization mode.
add_task(function() {
BrowserFullScreen();
let shownPanelPromise = promisePanelShown(window);
PanelUI.toggle({type: "command"});
yield shownPanelPromise;

let fullscreenButton = document.getElementById("fullscreen-button");
ok(fullscreenButton.checked, "Fullscreen button should be checked when in fullscreen.")

yield startCustomizing();

let fullscreenButtonWrapper = document.getElementById("wrapper-fullscreen-button");
ok(fullscreenButtonWrapper.hasAttribute("itemobserves"), "Observer should be moved to wrapper");
fullscreenButton = document.getElementById("fullscreen-button");
ok(!fullscreenButton.hasAttribute("observes"), "Observer should be removed from button");
ok(!fullscreenButton.checked, "Fullscreen button should no longer be checked during customization mode");

yield endCustomizing();
BrowserFullScreen();
shownPanelPromise = promisePanelShown(window);
PanelUI.toggle({type: "command"});
yield shownPanelPromise;

fullscreenButton = document.getElementById("fullscreen-button");
ok(!fullscreenButton.checked, "Fullscreen button should not be checked when not in fullscreen.")

let hiddenPanelPromise = promisePanelHidden(window);
PanelUI.toggle({type: "command"});
yield hiddenPanelPromise;
});

0 comments on commit 8424078

Please sign in to comment.