| Index: third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-2.html
|
| diff --git a/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-2.html b/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-2.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..921fcdc74b0987ec46884f6ed283e23af0187b92
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-2.html
|
| @@ -0,0 +1,92 @@
|
| +<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 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);
|
| + },
|
| + ]);
|
| +}
|
| +
|
| +</script>
|
| +</head>
|
| +
|
| +<body onload="runTest()">
|
| +<p>
|
| +Tests that user can mutate DOM by means of elements panel.
|
| +</p>
|
| +
|
| +<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>
|
| +</body>
|
| +</html>
|
|
|