Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector-protocol / dom / dom-childNodeCount.html
blob351cd1e2e90966298b2ed53dd0667df9eed484ad
1 <html>
2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
4 <script>
6 function addNode()
8 var container = document.getElementById("container");
9 container.appendChild(document.createElement("div"));
12 function removeNode()
14 var container = document.getElementById("container");
15 container.firstChild.remove();
18 function test()
20 var nodeInfo = {};
21 var containerNodeId;
22 InspectorTest.eventHandler["DOM.setChildNodes"] = setChildNodes;
23 InspectorTest.eventHandler["DOM.childNodeCountUpdated"] = childNodeCountUpdated;
25 InspectorTest.sendCommand("DOM.getDocument", {}, onGotDocument);
27 function onGotDocument(msg)
29 if (InspectorTest.completeTestIfError(msg))
30 return;
31 InspectorTest.sendCommand("DOM.querySelector", { nodeId: msg.result.root.nodeId, selector: "#container" }, onQuerySelector);
34 function onQuerySelector(msg)
36 if (InspectorTest.completeTestIfError(msg))
37 return;
38 containerNodeId = msg.result.nodeId;
39 InspectorTest.log("Node arrived with childNodeCount: " + nodeInfo[containerNodeId].childNodeCount);
41 InspectorTest.sendCommand("Runtime.evaluate", { expression: "addNode()"});
42 InspectorTest.sendCommand("Runtime.evaluate", { expression: "removeNode()"});
43 InspectorTest.sendCommand("Runtime.evaluate", { expression: "removeNode()"});
44 InspectorTest.sendCommand("Runtime.evaluate", { expression: "removeNode()"},
45 InspectorTest.completeTest.bind(InspectorTest));
48 function setChildNodes(message)
50 var nodes = message.params.nodes;
51 for (var i = 0; i < nodes.length; ++i) {
52 nodeInfo[nodes[i].nodeId] = nodes[i];
53 delete nodes[i].nodeId;
57 function childNodeCountUpdated(message)
59 if (message.params.nodeId === containerNodeId)
60 InspectorTest.log("childCountUpdated: " + message.params.childNodeCount);
64 </script>
65 </head>
66 <body onload="runTest()">
67 <div id="container" style="display:none"><div>child1</div><div>child2</div></div>
68 </body>
69 </html>