Index: LayoutTests/inspector/elements/edit-dom-actions.html |
diff --git a/LayoutTests/inspector/elements/edit-dom-actions.html b/LayoutTests/inspector/elements/edit-dom-actions.html |
deleted file mode 100644 |
index 5c17d3ae03b763006464c92fd7cd9e159c69e817..0000000000000000000000000000000000000000 |
--- a/LayoutTests/inspector/elements/edit-dom-actions.html |
+++ /dev/null |
@@ -1,298 +0,0 @@ |
-<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 testRemove(next) |
- { |
- InspectorTest.domActionTestForNodeId("testRemove", "node-to-remove", testBody, next); |
- |
- function testBody(node, done) |
- { |
- var treeElement = InspectorTest.firstElementsTreeOutline().findTreeElement(node); |
- treeElement.remove(); |
- InspectorTest.runAfterPendingDispatches(done); |
- } |
- }, |
- |
- function testSetNodeName(next) |
- { |
- InspectorTest.domActionTestForNodeId("testSetNodeName", "node-to-set-name", testBody, next); |
- |
- function testBody(node, done) |
- { |
- InspectorTest.editNodePartAndRun(node, "webkit-html-tag-name", "span", done); |
- } |
- }, |
- |
- function testSetNodeNameInput(next) |
- { |
- InspectorTest.domActionTestForNodeId("testSetNodeNameInput", "node-to-set-name-input", testBody, next); |
- |
- function testBody(node, done) |
- { |
- InspectorTest.editNodePartAndRun(node, "webkit-html-tag-name", "input", done); |
- } |
- }, |
- |
- function testSetNodeValue(next) |
- { |
- InspectorTest.domActionTestForNodeId("testSetNodeValue", "node-to-set-value", testBody, next); |
- |
- function testBody(node, done) |
- { |
- InspectorTest.editNodePartAndRun(node, "webkit-html-text-node", " \n Edited Text \n ", done); |
- } |
- }, |
- |
- function testSetAttribute(next) |
- { |
- InspectorTest.domActionTestForNodeId("testSetAttribute", "node-to-set-attribute", testBody, next); |
- |
- function testBody(node, done) |
- { |
- InspectorTest.editNodePartAndRun(node, "webkit-html-attribute", "bar=\"edited attribute\"", done, true); |
- } |
- }, |
- |
- function testSetScriptableAttribute(next) |
- { |
- InspectorTest.domActionTestForNodeId("testSetScriptableAttribute", "node-to-set-scriptable-attribute", testBody, next); |
- |
- function testBody(node, done) |
- { |
- InspectorTest.editNodePartAndRun(node, "webkit-html-attribute", "onclick=\"alert(2)\"", done, true); |
- } |
- }, |
- |
- function testRemoveAttribute(next) |
- { |
- InspectorTest.domActionTestForNodeId("testRemoveAttribute", "node-to-remove-attribute", testBody, next); |
- |
- function testBody(node, done) |
- { |
- InspectorTest.editNodePartAndRun(node, "webkit-html-attribute", "", done, true); |
- } |
- }, |
- |
- function testAddAttribute(next) |
- { |
- InspectorTest.doAddAttribute("testAddAttribute", "node-to-add-attribute", "newattr=\"new-value\"", next); |
- }, |
- |
- function testAddAttributeUnquotedValue(next) |
- { |
- InspectorTest.doAddAttribute("testAddAttributeUnquotedValue", "node-to-add-attribute-unquoted-value", "newattr=unquotedValue", next); |
- }, |
- |
- function testEditCommentAsHTML(next) |
- { |
- function commentNodeSelectionCallback(testNode, callback) |
- { |
- var childNodes = testNode.children(); |
- for (var i = 0; i < childNodes.length; ++i) { |
- if (childNodes[i].nodeType() === 8) { |
- WebInspector.Revealer.reveal(childNodes[i]); |
- callback(childNodes[i]); |
- return; |
- } |
- } |
- InspectorTest.addResult("Comment node not found"); |
- InspectorTest.completeTest(); |
- } |
- InspectorTest.domActionTest("testEditCommentAsHTML", commentNodeSelectionCallback, testBody, next); |
- |
- function testBody(node, done) |
- { |
- var treeOutline = InspectorTest.firstElementsTreeOutline(); |
- var treeElement = treeOutline.findTreeElement(node); |
- treeOutline._toggleEditAsHTML(node); |
- InspectorTest.runAfterPendingDispatches(step2); |
- |
- function step2() |
- { |
- InspectorTest.addResult(treeElement._editing.codeMirror.getValue()); |
- treeElement._editing.codeMirror.setValue("<div foo=\"bar-comment\">Element</div>"); |
- var event = InspectorTest.createKeyEvent("Enter"); |
- event.isMetaOrCtrlForTest = true; |
- treeElement._htmlEditElement.dispatchEvent(event); |
- InspectorTest.runAfterPendingDispatches(done); |
- } |
- } |
- }, |
- |
- function testEditAsHTML(next) |
- { |
- InspectorTest.domActionTestForNodeId("testEditAsHTML", "node-to-edit-as-html", testBody, next); |
- |
- function testBody(node, done) |
- { |
- var treeOutline = InspectorTest.firstElementsTreeOutline(); |
- var treeElement = treeOutline.findTreeElement(node); |
- treeOutline._toggleEditAsHTML(node); |
- InspectorTest.runAfterPendingDispatches(step2); |
- |
- function step2() |
- { |
- InspectorTest.addResult(treeElement._editing.codeMirror.getValue()); |
- treeElement._editing.codeMirror.setValue("<span foo=\"bar\"><span id=\"inner-span\">Span contents</span></span>"); |
- var event = InspectorTest.createKeyEvent("Enter"); |
- event.isMetaOrCtrlForTest = true; |
- treeElement._htmlEditElement.dispatchEvent(event); |
- InspectorTest.runAfterPendingDispatches(InspectorTest.expandElementsTree.bind(InspectorTest, done)); |
- } |
- } |
- }, |
- |
- 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="testRemove"> |
- <div id="node-to-remove"></div> |
- </div> |
- |
- <div id="testSetNodeName"> |
- <div id="node-to-set-name"></div> |
- </div> |
- |
- <div id="testSetNodeNameInput"> |
- <div id="node-to-set-name-input"></div> |
- </div> |
- |
- <div id="testSetNodeValue"> |
- <div id="node-to-set-value"> |
- Text |
- </div> |
- </div> |
- |
- <div id="testSetAttribute"> |
- <div foo="attribute value" id="node-to-set-attribute"></div> |
- </div> |
- |
- <div id="testSetScriptableAttribute"> |
- <div onclick="alert(1)" id="node-to-set-scriptable-attribute"></div> |
- </div> |
- |
- <div id="testRemoveAttribute"> |
- <div foo="attribute value" id="node-to-remove-attribute"></div> |
- </div> |
- |
- <div id="testAddAttribute"> |
- <div id="node-to-add-attribute"></div> |
- </div> |
- |
- <div id="testAddAttributeUnquotedValue"> |
- <div id="node-to-add-attribute-unquoted-value"></div> |
- </div> |
- |
- <div id="testEditAsHTML"> |
- <div id="node-to-edit-as-html"><span id="span">Text</span></div> |
- </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 id="testEditCommentAsHTML"> |
- <!-- Comment --> |
- </div> |
-</div> |
-</body> |
-</html> |