mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-30 21:55:31 +00:00
Bug 989289 - Forcibly set the 'mode' attribute to 'icons' on toolbar construction. r=jaws.
This commit is contained in:
parent
104c587e79
commit
4a167429d8
@ -45,6 +45,11 @@
|
||||
Cu.import("resource:///modules/CustomizableUI.jsm", scope);
|
||||
let CustomizableUI = scope.CustomizableUI;
|
||||
|
||||
// Bug 989289: Forcibly set the now unsupported "mode" attribute, just
|
||||
// in case it gets accidentally restored from persistence from a user
|
||||
// that's been upgrading and downgrading.
|
||||
this.setAttribute("mode", "icons");
|
||||
|
||||
// Searching for the toolbox palette in the toolbar binding because
|
||||
// toolbars are constructed first.
|
||||
let toolbox = this.toolbox;
|
||||
|
@ -94,4 +94,5 @@ skip-if = os == "linux"
|
||||
[browser_987177_destroyWidget_xul.js]
|
||||
[browser_987177_xul_wrapper_updating.js]
|
||||
[browser_987492_window_api.js]
|
||||
[browser_989289_force_icons_mode_attribute.js]
|
||||
[browser_panel_toggle.js]
|
||||
|
@ -0,0 +1,31 @@
|
||||
/* 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";
|
||||
|
||||
const kToolbarID = "test-toolbar";
|
||||
|
||||
/**
|
||||
* Tests that customizable toolbars are forced to have their mode
|
||||
* attribute set to "icons".
|
||||
*/
|
||||
add_task(function* testAddingToolbar() {
|
||||
let toolbar = document.createElement("toolbar");
|
||||
toolbar.setAttribute("mode", "full");
|
||||
toolbar.setAttribute("customizable", "true");
|
||||
toolbar.setAttribute("id", kToolbarID);
|
||||
|
||||
CustomizableUI.registerArea(kToolbarID, {
|
||||
type: CustomizableUI.TYPE_TOOLBAR,
|
||||
legacy: false,
|
||||
})
|
||||
|
||||
gNavToolbox.appendChild(toolbar);
|
||||
|
||||
is(toolbar.getAttribute("mode"), "icons",
|
||||
"Toolbar should have its mode attribute set to icons.")
|
||||
|
||||
toolbar.remove();
|
||||
CustomizableUI.unregisterArea(kToolbarID);
|
||||
});
|
Loading…
Reference in New Issue
Block a user