browser/components/customizableui/test/browser_992747_toggle_noncustomizable_toolbar.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/components/customizableui/test/browser_992747_toggle_noncustomizable_toolbar.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,26 @@
     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 +const TOOLBARID = "test-noncustomizable-toolbar-for-toggling";
    1.11 +function test() {
    1.12 +  let tb = document.createElementNS(kNSXUL, "toolbar");
    1.13 +  tb.id = TOOLBARID;
    1.14 +  gNavToolbox.appendChild(tb);
    1.15 +  try {
    1.16 +    CustomizableUI.setToolbarVisibility(TOOLBARID, false);
    1.17 +  } catch (ex) {
    1.18 +    ok(false, "Should not throw exceptions trying to set toolbar visibility.");
    1.19 +  }
    1.20 +  is(tb.getAttribute("collapsed"), "true", "Toolbar should be collapsed");
    1.21 +  try {
    1.22 +    CustomizableUI.setToolbarVisibility(TOOLBARID, true);
    1.23 +  } catch (ex) {
    1.24 +    ok(false, "Should not throw exceptions trying to set toolbar visibility.");
    1.25 +  }
    1.26 +  is(tb.getAttribute("collapsed"), "false", "Toolbar should be uncollapsed");
    1.27 +  tb.remove();
    1.28 +};
    1.29 +

mercurial