| Index: third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-4.html
|
| diff --git a/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-4.html b/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-4.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..75f22755eac2cf454ce1515a531eb14eea6ae1f6
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-4.html
|
| @@ -0,0 +1,111 @@
|
| +<html>
|
| +<head>
|
| +<script src="../../../http/tests/inspector/inspector-test.js"></script>
|
| +<script src="../../../http/tests/inspector/elements-test.js"></script>
|
| +<script src="edit-dom-test.js"></script>
|
| +<script>
|
| +
|
| +function test()
|
| +{
|
| + // Save time on style updates.
|
| + WebInspector.StylesSidebarPane.prototype.update = function() {};
|
| + WebInspector.MetricsSidebarPane.prototype.update = function() {};
|
| +
|
| + InspectorTest.runTestSuite([
|
| + function testSetUp(next)
|
| + {
|
| + InspectorTest.expandElementsTree(next);
|
| + },
|
| +
|
| + function testEditInvisibleCharsAsHTML(next)
|
| + {
|
| + InspectorTest.domActionTestForNodeId("testEditInvisibleCharsAsHTML", "node-with-invisible-chars", testBody, next);
|
| +
|
| + function testBody(node, done)
|
| + {
|
| + var treeOutline = InspectorTest.firstElementsTreeOutline();
|
| + var treeElement = treeOutline.findTreeElement(node);
|
| + treeOutline.toggleEditAsHTML(node);
|
| + InspectorTest.runAfterPendingDispatches(step2);
|
| +
|
| + function step2()
|
| + {
|
| + var codeMirror = treeElement._editing.codeMirror;
|
| + InspectorTest.addResult(codeMirror.getValue());
|
| + codeMirror.setValue(codeMirror.getValue().replace(/&/g, '#'));
|
| + var event = InspectorTest.createKeyEvent("Enter");
|
| + event.isMetaOrCtrlForTest = true;
|
| + treeElement._htmlEditElement.dispatchEvent(event);
|
| + InspectorTest.runAfterPendingDispatches(InspectorTest.expandElementsTree.bind(InspectorTest, done));
|
| + }
|
| + }
|
| + },
|
| +
|
| + function testEditScript(next)
|
| + {
|
| + InspectorTest.domActionTestForNodeId("testEditScript", "node-to-edit-script", testBody, next);
|
| +
|
| + function testBody(node, done)
|
| + {
|
| + InspectorTest.editNodePartAndRun(node, "webkit-html-text-node", "var i = 0;\n var j = 0;\n", done);
|
| + }
|
| + },
|
| +
|
| + function testEditSVGAttribute(next)
|
| + {
|
| + InspectorTest.domActionTestForNodeId("testEditSVG", "node-to-edit-svg-attribute", testBody, next);
|
| +
|
| + function testBody(node, done)
|
| + {
|
| + var treeOutline = InspectorTest.firstElementsTreeOutline();
|
| + var treeElement = treeOutline.findTreeElement(node);
|
| + treeOutline.toggleEditAsHTML(node);
|
| + InspectorTest.runAfterPendingDispatches(step2);
|
| +
|
| + function step2()
|
| + {
|
| + var value = treeElement._editing.codeMirror.getValue();
|
| + InspectorTest.addResult(value);
|
| + treeElement._editing.codeMirror.setValue(value.replace("100", "110"));
|
| + var event = InspectorTest.createKeyEvent("Enter");
|
| + event.isMetaOrCtrlForTest = true;
|
| + treeElement._htmlEditElement.dispatchEvent(event);
|
| + InspectorTest.runAfterPendingDispatches(InspectorTest.expandElementsTree.bind(InspectorTest, done));
|
| + }
|
| + }
|
| + }
|
| + ]);
|
| +}
|
| +
|
| +</script>
|
| +</head>
|
| +
|
| +<body onload="runTest()">
|
| +<p>
|
| +Tests that user can mutate DOM by means of elements panel.
|
| +</p>
|
| +
|
| +<div>
|
| + <div id="testEditInvisibleCharsAsHTML">
|
| + <div id="node-with-invisible-chars">A B C D E‌F‍G‏H‎I</div>
|
| + </div>
|
| +
|
| + <div id="testEditScript">
|
| + <script id="node-to-edit-script">
|
| +
|
| + var i = 0;
|
| + var j = 5;
|
| + for (; i < j; ++i) {
|
| + // Do nothing.
|
| + }
|
| +
|
| + </script>
|
| + </div>
|
| +
|
| + <div id="testEditSVG">
|
| + <svg id="node-to-edit-svg-attribute" xmlns:xlink="test" width="100">
|
| + </svg>
|
| + </div>
|
| +</div>
|
| +</body>
|
| +</html>
|
|
|