Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-request-child-nodes-depth.html

Issue 2955943002: DevTools: migrate inspector-protocol/dom tests to a new test runner (Closed)
Patch Set: rebaseline Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-request-child-nodes-depth.html
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-request-child-nodes-depth.html b/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-request-child-nodes-depth.html
deleted file mode 100644
index 4d5bed22a2aca6236b4c24a0266cae891495651c..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-request-child-nodes-depth.html
+++ /dev/null
@@ -1,165 +0,0 @@
-<html>
-<head>
-<script type="text/javascript" src="../../http/tests/inspector-protocol/resources/inspector-protocol-test.js"></script>
-<script type="text/javascript">
-
-function test()
-{
- var firstDiv;
- var eventsCount = 0;
-
- getDocument();
-
- InspectorTest.eventHandler["DOM.setChildNodes"] = function setChildNodes(messageObject)
- {
- eventsCount++;
-
- if (eventsCount === 1)
- gotImmediateChildren(messageObject);
- else if (eventsCount === 2)
- gotAdditionalChildren(messageObject);
- else if (eventsCount === 3)
- gotAllChildren(messageObject);
- else
- InspectorTest.log(JSON.stringify(messageObject, null, " "));
- };
-
- function getDocument()
- {
- // We must first get the document so that later on we may get sensible nodeIds.
- step({
- name: "Get the Document",
- command: "DOM.getDocument",
- parameters: {},
- callback: getImmediateChildren
- });
- };
-
- function getImmediateChildren(result)
- {
- var bodyId = result.root.children[0].children[1].nodeId;
- step({
- name: "Get immediate children of the body",
- command: "DOM.requestChildNodes",
- parameters: {"nodeId": bodyId}
- });
- };
-
- function gotImmediateChildren(messageObject)
- {
- firstDiv = messageObject.params.nodes[0];
- assert("First child is a div", firstDiv.localName, "div");
- assert("First child is div#depth-1", firstDiv.attributes[1], "depth-1");
- assert("First child has one child", firstDiv.childNodeCount, 1);
- assert("First child has no .children property", firstDiv.children, undefined);
-
- step({
- name: "Get children of div#depth-1 three levels deep",
- command: "DOM.requestChildNodes",
- parameters: {"nodeId": firstDiv.nodeId, "depth": 3}
- });
- };
-
- function gotAdditionalChildren(messageObject)
- {
- var depth = 1;
- var firstChild = messageObject.params.nodes[0];
- var node = firstChild;
- while (node && node.children) {
- depth++;
- node = node.children[0];
- }
-
- assert("div#depth-1 has nodes 3 levels deep", depth, 3);
-
- step({
- name: "Get all children of body",
- command: "DOM.requestChildNodes",
- parameters: {"nodeId": firstDiv.nodeId, "depth": -1}
- });
- };
-
- function gotAllChildren(messageObject)
- {
- var depth = 0;
- var firstChild = messageObject.params.nodes[0];
- var node = firstChild;
- while (node && node.children) {
- depth++;
- node = node.children[0];
- }
-
- // We have requested nodes 3-level deep so far, so
- // we should have gotten an additional 6 levels of depth.
- assert("div#depth-1 has nodes 9 levels deep", depth, 6);
-
- step({
- name: "Pass an invalid depth",
- command: "DOM.requestChildNodes",
- parameters: {"nodeId": firstDiv.nodeId, "depth": 0},
- callback: finishTest
- });
- };
-
- function finishTest()
- {
- assert("Expected number of setChildNodes events", eventsCount, 3);
-
- InspectorTest.completeTest();
- };
-
- 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 assert(message, actual, expected)
- {
- if (actual === expected)
- InspectorTest.log("PASS: " + message);
- else {
- InspectorTest.log("FAIL: " + message + ", expected \"" + expected + "\" but got \"" + actual + "\"");
- InspectorTest.completeTest();
- }
- };
-
-};
-
-window.addEventListener("DOMContentLoaded", function () {
- runTest();
-}, false);
-
-</script>
-</head>
-<body>
-
-<div id="depth-1">
- <div id="depth-2">
- <div id="depth-3">
- <div id="depth-4">
- <div id="depth-5">
- <div id="depth-6">
- <div id="depth-7">
- <div id="depth-8">
- <div id="depth-9">
- <div id="depth-10">
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
-</div>
-
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698