Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector-protocol / dom / dom-getNodeForLocation.html
blobe21e4b3b8ee5127cb6768522ccb785b14da31621
1 <html>
2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
4 <script>
6 function test()
8 var nodeInfo = {};
9 InspectorTest.eventHandler["DOM.setChildNodes"] = setChildNodes;
10 InspectorTest.sendCommand("DOM.enable", {});
11 InspectorTest.sendCommand("DOM.getNodeForLocation", { "x": 10, "y": 10 }, onGetNodeForLocation);
13 function onGetNodeForLocation(message)
15 if (message.error) {
16 InspectorTest.log(message.error.message);
17 InspectorTest.completeTest();
18 return;
20 var nodeId = message.result.nodeId;
21 InspectorTest.logObject(nodeInfo[nodeId], "Node: ");
22 InspectorTest.completeTest();
25 function setChildNodes(message)
27 var nodes = message.params.nodes;
28 for (var i = 0; i < nodes.length; ++i) {
29 nodeInfo[nodes[i].nodeId] = nodes[i];
30 delete nodes[i].nodeId;
35 </script>
36 </head>
37 <body onload="runTest()">
38 <div style="position:absolute;top:0;left:0;width:100;height:100"></div>
39 </body>
40 </html>