summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/inspector-protocol/accessibility/accessibility-getNodeWithNoAXNode.html
blob: 8575e1b5fccb9e699c5702bc1f4628036f082a04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<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": "head" }, onQuerySelector);
    }

    function onQuerySelector(msg)
    {
        if (msg.error) {
            InspectorTest.log(msg.error.message);
            InspectorTest.completeTest();
            return;
        }
        var node = msg.result;
        InspectorTest.sendCommand("Accessibility.getAXNode", { "nodeId": node.nodeId }, onGotAccessibilityNode);
    }

    function onGotAccessibilityNode(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
        InspectorTest.log('result: ' + JSON.stringify(msg.result, null, "  "));
        InspectorTest.completeTest();
    }
}

</script>
</head>
<body onLoad="runTest();">
  <input type="text"></input>
</body>
</html>