browser/devtools/markupview/test/browser_markupview_textcontent_edit_01.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:ec82439eb96b
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/ */
4
5 "use strict";
6
7 // Test editing a node's text content
8
9 const TEST_URL = TEST_URL_ROOT + "doc_markup_edit.html";
10
11 let test = asyncTest(function*() {
12 let {inspector} = yield addTab(TEST_URL).then(openInspector);
13
14 info("Expanding all nodes");
15 yield inspector.markup.expandAll();
16
17 let node = getNode(".node6").firstChild;
18 is(node.nodeValue, "line6", "The test node's text content is correct");
19
20 info("Changing the text content");
21
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;
28
29 is(node.nodeValue, "New text", "Test test node's text content has changed");
30
31 yield inspector.once("inspector-updated");
32 });

mercurial