summaryrefslogtreecommitdiffstats
path: root/devtools/client/inspector/markup/test/browser_markup_tag_edit_11.js
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/client/inspector/markup/test/browser_markup_tag_edit_11.js')
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_tag_edit_11.js38
1 files changed, 38 insertions, 0 deletions
diff --git a/devtools/client/inspector/markup/test/browser_markup_tag_edit_11.js b/devtools/client/inspector/markup/test/browser_markup_tag_edit_11.js
new file mode 100644
index 000000000..906c4aced
--- /dev/null
+++ b/devtools/client/inspector/markup/test/browser_markup_tag_edit_11.js
@@ -0,0 +1,38 @@
+/* vim: set ts=2 et sw=2 tw=80: */
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Bug 1090874 - Tests that a node is not recreated when it's tagname editor
+// is blurred and no changes were done.
+
+const TEST_URL = "data:text/html;charset=utf-8,<div></div>";
+
+add_task(function* () {
+ let isEditTagNameCalled = false;
+
+ let {inspector} = yield openInspectorForURL(TEST_URL);
+
+ // Overriding the editTagName walkerActor method here to check that it isn't
+ // called when blurring the tagname field.
+ inspector.walker.editTagName = function () {
+ isEditTagNameCalled = true;
+ };
+
+ let container = yield focusNode("div", inspector);
+ let tagEditor = container.editor.tag;
+
+ info("Blurring the tagname field");
+ tagEditor.blur();
+ is(isEditTagNameCalled, false, "The editTagName method wasn't called");
+
+ info("Updating the tagname to uppercase");
+ yield focusNode("div", inspector);
+ setEditableFieldValue(tagEditor, "DIV", inspector);
+ is(isEditTagNameCalled, false, "The editTagName method wasn't called");
+
+ info("Updating the tagname to a different value");
+ setEditableFieldValue(tagEditor, "SPAN", inspector);
+ is(isEditTagNameCalled, true, "The editTagName method was called");
+});