Bug 977033 - Add test for bug 963639 - checking customizing attribute on non customizable toolbar. r=Gijs
authorMihaela Velimiroviciu <mihaela.velimiroviciu@softvisioninc.eu>
Wed, 26 Feb 2014 15:58:58 +0200
changeset 173578 d36aeeed76a9179374151f942897eec81af2b591
parent 173577 21c0c5f02e83d73ebfd779bc1a383bf6c68c21f1
child 173579 12914d8e8063de11b455cf70c9dfe355fff64dae
push id26413
push userkwierso@gmail.com
push dateSat, 15 Mar 2014 02:20:55 +0000
treeherdermozilla-central@070c0ae53861 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs977033, 963639
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 977033 - Add test for bug 963639 - checking customizing attribute on non customizable toolbar. r=Gijs
browser/components/customizableui/test/browser.ini
browser/components/customizableui/test/browser_963639_customizing_attribute_non_customizable_toolbar.js
--- a/browser/components/customizableui/test/browser.ini
+++ b/browser/components/customizableui/test/browser.ini
@@ -60,16 +60,17 @@ skip-if = os == "linux"
 [browser_942581_unregisterArea_keeps_placements.js]
 [browser_943683_migration_test.js]
 [browser_944887_destroyWidget_should_destroy_in_palette.js]
 [browser_945739_showInPrivateBrowsing_customize_mode.js]
 [browser_947987_removable_default.js]
 [browser_948985_non_removable_defaultArea.js]
 [browser_952963_areaType_getter_no_area.js]
 [browser_956602_remove_special_widget.js]
+[browser_963639_customizing_attribute_non_customizable_toolbar.js]
 [browser_968447_bookmarks_toolbar_items_in_panel.js]
 [browser_968565_insert_before_hidden_items.js]
 [browser_969427_recreate_destroyed_widget_after_reset.js]
 [browser_969661_character_encoding_navbar_disabled.js]
 [browser_970511_undo_restore_default.js]
 [browser_972267_customizationchange_events.js]
 [browser_973932_addonbar_currentset.js]
 [browser_975719_customtoolbars_behaviour.js]
new file mode 100644
--- /dev/null
+++ b/browser/components/customizableui/test/browser_963639_customizing_attribute_non_customizable_toolbar.js
@@ -0,0 +1,34 @@
+/* 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 kToolbar = "test-toolbar-963639-non-customizable-customizing-attribute";
+
+add_task(function() {
+  info("Test for Bug 963639 - CustomizeMode _onToolbarVisibilityChange sets @customizing on non-customizable toolbars");
+
+  let toolbar = document.createElement("toolbar");
+  toolbar.id = kToolbar;
+  gNavToolbox.appendChild(toolbar);
+
+  let testToolbar = document.getElementById(kToolbar)
+  ok(testToolbar, "Toolbar was created.");
+  is(gNavToolbox.getElementsByAttribute("id", kToolbar).length, 1,
+     "Toolbar was added to the navigator toolbox");
+
+  toolbar.setAttribute("toolbarname", "NonCustomizableToolbarCustomizingAttribute");
+  toolbar.setAttribute("collapsed", "true");
+
+  yield startCustomizing();
+  window.setToolbarVisibility(toolbar, "true");
+  isnot(toolbar.getAttribute("customizing"), "true",
+        "Toolbar doesn't have the customizing attribute");
+
+  yield endCustomizing();
+  gNavToolbox.removeChild(toolbar);
+
+  is(gNavToolbox.getElementsByAttribute("id", kToolbar).length, 0,
+     "Toolbar was removed from the navigator toolbox");
+});