Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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 });