michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: "use strict"; michael@0: michael@0: // Test editing a node's text content michael@0: michael@0: const TEST_URL = TEST_URL_ROOT + "doc_markup_edit.html"; michael@0: michael@0: let test = asyncTest(function*() { michael@0: let {inspector} = yield addTab(TEST_URL).then(openInspector); michael@0: michael@0: info("Expanding all nodes"); michael@0: yield inspector.markup.expandAll(); michael@0: michael@0: let node = getNode(".node6").firstChild; michael@0: is(node.nodeValue, "line6", "The test node's text content is correct"); michael@0: michael@0: info("Changing the text content"); michael@0: michael@0: info("Listening to the markupmutation event"); michael@0: let onMutated = inspector.once("markupmutation"); michael@0: let editor = getContainerForRawNode(node, inspector).editor; michael@0: let field = editor.elt.querySelector("pre"); michael@0: setEditableFieldValue(field, "New text", inspector); michael@0: yield onMutated; michael@0: michael@0: is(node.nodeValue, "New text", "Test test node's text content has changed"); michael@0: michael@0: yield inspector.once("inspector-updated"); michael@0: });