diff -r 000000000000 -r 6474c204b198 browser/devtools/markupview/test/browser_markupview_textcontent_edit_01.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/browser/devtools/markupview/test/browser_markupview_textcontent_edit_01.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,32 @@ +/* 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"; + +// Test editing a node's text content + +const TEST_URL = TEST_URL_ROOT + "doc_markup_edit.html"; + +let test = asyncTest(function*() { + let {inspector} = yield addTab(TEST_URL).then(openInspector); + + info("Expanding all nodes"); + yield inspector.markup.expandAll(); + + let node = getNode(".node6").firstChild; + is(node.nodeValue, "line6", "The test node's text content is correct"); + + info("Changing the text content"); + + info("Listening to the markupmutation event"); + let onMutated = inspector.once("markupmutation"); + let editor = getContainerForRawNode(node, inspector).editor; + let field = editor.elt.querySelector("pre"); + setEditableFieldValue(field, "New text", inspector); + yield onMutated; + + is(node.nodeValue, "New text", "Test test node's text content has changed"); + + yield inspector.once("inspector-updated"); +});