blob: 8e9e328872c4e1a513287f27269fe1b7b7128f02 [file] [log] [blame]
<html>
<head>
<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
<script>
function test()
{
InspectorTest.sendCommand("DOM.getDocument", {}, onGotDocument);
function onGotDocument(msg)
{
if (msg.error) {
InspectorTest.log(msg.error.message);
InspectorTest.completeTest();
return;
}
var rootNode = msg.result.root;
InspectorTest.sendCommand("DOM.querySelector", { "nodeId": rootNode.nodeId, "selector": "input" }, onQuerySelector);
}
function onQuerySelector(msg)
{
if (msg.error) {
InspectorTest.log(msg.error.message);
InspectorTest.completeTest();
return;
}
var node = msg.result;
InspectorTest.sendCommand("Accessibility.getAXNodeChain", { "nodeId": node.nodeId, "fetchAncestors": false }, onGotAccessibilityNode.bind(null, node));
}
function onGotAccessibilityNode(domNode, msg)
{
if (msg.error) {
InspectorTest.log(msg.error.message);
InspectorTest.completeTest();
return;
}
// nodeId isn't always the same, so set it to a known value if it's present
if (msg.result && "nodes" in msg.result && "nodeId" in msg.result.nodes[0])
msg.result.nodes[0].nodeId = "3";
InspectorTest.log('result: ' + JSON.stringify(msg.result, null, " "));
InspectorTest.completeTest();
}
}
</script>
</head>
<body onLoad="runTest();">
<input type="text"></input>
</body>
</html>