3 <script type=
"text/javascript" src=
"../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
9 InspectorTest
.eventHandler
["DOM.setChildNodes"] = setChildNodes
;
10 InspectorTest
.eventHandler
["DOM.inspectNodeRequested"] = inspectNodeRequested
;
11 InspectorTest
.sendCommand("DOM.enable", {});
12 InspectorTest
.sendCommand("DOM.setInspectMode", { "mode": "searchForNode", highlightConfig
: {} }, onSetModeEnabled
);
14 function onSetModeEnabled(message
)
17 InspectorTest
.log(message
.error
.message
);
18 InspectorTest
.completeTest();
22 InspectorTest
.sendCommand("Input.dispatchMouseEvent", { "type": "mouseMoved", "button": "left", "clickCount": 1, "x": 150, "y": 150 });
23 InspectorTest
.sendCommand("Input.dispatchMouseEvent", { "type": "mousePressed", "button": "left", "clickCount": 1, "x": 150, "y": 150 });
24 InspectorTest
.sendCommand("Input.dispatchMouseEvent", { "type": "mouseReleased", "button": "left", "clickCount": 1, "x": 150, "y": 150 });
27 function setChildNodes(message
)
29 var nodes
= message
.params
.nodes
;
30 for (var i
= 0; i
< nodes
.length
; ++i
) {
31 nodeInfo
[nodes
[i
].nodeId
] = nodes
[i
];
32 delete nodes
[i
].nodeId
;
36 function inspectNodeRequested(message
)
38 InspectorTest
.sendCommand("DOM.pushNodesByBackendIdsToFrontend", { "backendNodeIds": [ message
.params
.backendNodeId
] }, onNodeResolved
);
41 function onNodeResolved(message
)
43 InspectorTest
.log("DOM.inspectNodeRequested: " + nodeInfo
[message
.result
.nodeIds
[0]].localName
);
44 InspectorTest
.completeTest();
50 <body onload=
"runTest()">
51 <div style=
"position:absolute;top:100;left:100;width:100;height:100;background:black"></div>