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: const TOOLBARID = "test-noncustomizable-toolbar-for-toggling"; michael@0: function test() { michael@0: let tb = document.createElementNS(kNSXUL, "toolbar"); michael@0: tb.id = TOOLBARID; michael@0: gNavToolbox.appendChild(tb); michael@0: try { michael@0: CustomizableUI.setToolbarVisibility(TOOLBARID, false); michael@0: } catch (ex) { michael@0: ok(false, "Should not throw exceptions trying to set toolbar visibility."); michael@0: } michael@0: is(tb.getAttribute("collapsed"), "true", "Toolbar should be collapsed"); michael@0: try { michael@0: CustomizableUI.setToolbarVisibility(TOOLBARID, true); michael@0: } catch (ex) { michael@0: ok(false, "Should not throw exceptions trying to set toolbar visibility."); michael@0: } michael@0: is(tb.getAttribute("collapsed"), "false", "Toolbar should be uncollapsed"); michael@0: tb.remove(); michael@0: }; michael@0: