Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 /* vim: set ts=2 et sw=2 tw=80: */
2 /* Any copyright is dedicated to the Public Domain.
3 http://creativecommons.org/publicdomain/zero/1.0/ */
5 "use strict";
7 // Test editing a node's text content
9 const TEST_URL = TEST_URL_ROOT + "doc_markup_edit.html";
11 let test = asyncTest(function*() {
12 let {inspector} = yield addTab(TEST_URL).then(openInspector);
14 info("Expanding all nodes");
15 yield inspector.markup.expandAll();
17 let node = getNode(".node6").firstChild;
18 is(node.nodeValue, "line6", "The test node's text content is correct");
20 info("Changing the text content");
22 info("Listening to the markupmutation event");
23 let onMutated = inspector.once("markupmutation");
24 let editor = getContainerForRawNode(node, inspector).editor;
25 let field = editor.elt.querySelector("pre");
26 setEditableFieldValue(field, "New text", inspector);
27 yield onMutated;
29 is(node.nodeValue, "New text", "Test test node's text content has changed");
31 yield inspector.once("inspector-updated");
32 });