Index: third_party/WebKit/LayoutTests/inspector-protocol/dom/push-children-on-pseudo-addition.html |
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/dom/push-children-on-pseudo-addition.html b/third_party/WebKit/LayoutTests/inspector-protocol/dom/push-children-on-pseudo-addition.html |
deleted file mode 100644 |
index 0b90be9bc929c68d68008271116f6695de39ad9e..0000000000000000000000000000000000000000 |
--- a/third_party/WebKit/LayoutTests/inspector-protocol/dom/push-children-on-pseudo-addition.html |
+++ /dev/null |
@@ -1,130 +0,0 @@ |
-<html> |
-<head> |
-<script type="text/javascript" src="../../http/tests/inspector-protocol/resources/inspector-protocol-test.js"></script> |
-<script> |
- |
-function addBeforeElement() |
-{ |
- document.getElementById("style").textContent = "#for-pseudo:before { content: \"BEFORE\" }"; |
-} |
- |
-function test() |
-{ |
- var nodeInfo = {}; |
- var childrenCallback; |
- |
- InspectorTest.eventHandler["DOM.setChildNodes"] = setChildNodes; |
- InspectorTest.eventHandler["DOM.pseudoElementAdded"] = pseudoElementAdded; |
- getDocument(); |
- |
- function getDocument() |
- { |
- step({ |
- name: "Get the Document", |
- command: "DOM.getDocument", |
- parameters: {}, |
- callback: getImmediateChildren |
- }); |
- }; |
- |
- function getImmediateChildren(result) |
- { |
- var bodyId = result.root.children[0].children[1].nodeId; |
- childrenCallback = onChildrenRequested; |
- step({ |
- name: "Get immediate children of the body", |
- command: "DOM.requestChildNodes", |
- parameters: {"nodeId": bodyId} |
- }); |
- }; |
- |
- function onChildrenRequested() |
- { |
- step({ |
- name: "Add #for-pseudo:before element", |
- command: "Runtime.evaluate", |
- parameters: {expression: "addBeforeElement()"} |
- }); |
- } |
- |
- function pseudoElementAdded(message) |
- { |
- var nodeData = findNodeById("inner-span"); |
- assertEquals(true, !!nodeData, "#inner-span has been received"); |
- InspectorTest.completeTest(); |
- } |
- |
- function setChildNodes(message) |
- { |
- var nodes = message.params.nodes; |
- for (var i = 0; i < nodes.length; ++i) |
- addNode(nodes[i]); |
- var callback = childrenCallback; |
- childrenCallback = null; |
- if (callback) |
- callback(); |
- } |
- |
- function step(test) |
- { |
- InspectorTest.log("\n=== " + test.name + " ===\n"); |
- InspectorTest.sendCommand(test.command, test.parameters, function(messageObject) { |
- if (messageObject.hasOwnProperty("error")) |
- InspectorTest.log("Backend error: " + messageObject.error.message + " (" + messageObject.error.code + ")\n"); |
- |
- if (test.callback) |
- test.callback(messageObject.result); |
- }); |
- } |
- |
- function findNodeById(id) |
- { |
- for (var nodeId in nodeInfo) { |
- var node = nodeInfo[nodeId]; |
- var attrs = node.attributes; |
- if (!attrs) |
- continue; |
- for (var i = 0; i < attrs.length; i += 2) { |
- var name = attrs[i]; |
- if (name !== "id") |
- continue; |
- if (attrs[i + 1] === id) |
- return {nodeId: nodeId, node: node}; |
- } |
- } |
- return null; |
- } |
- |
- function addNodesRecursive(root) |
- { |
- addNode(root); |
- if (!root.children) |
- return; |
- for (var i = 0; i < root.children.length; ++i) |
- addNodesRecursive(root.children[i]); |
- } |
- |
- function addNode(node) |
- { |
- nodeInfo[node.nodeId] = node; |
- delete node.nodeId; |
- } |
- |
- function assertEquals(expected, actual, message) |
- { |
- if (expected === actual) { |
- InspectorTest.log("PASS: " + message); |
- return; |
- } |
- InspectorTest.log("FAIL: " + message + ": expected: <" + expected + "> but found <" + actual + ">"); |
- } |
-} |
- |
-</script> |
-<style id="style"> |
-</style> |
-</head> |
-<body id="body" onload="runTest()"> |
-<div id="for-pseudo"><span id="inner-span"></span></div> |
-</body> |
-</html> |