| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> | 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> |
| 4 <script> | 4 <script> |
| 5 | 5 |
| 6 function test() | 6 function test() |
| 7 { | 7 { |
| 8 InspectorTest.sendCommand("DOM.getDocument", {}, onGotDocument); | 8 InspectorTest.sendCommand("DOM.getDocument", {}, onGotDocument); |
| 9 | 9 |
| 10 function onGotDocument(msg) | 10 function onGotDocument(msg) |
| 11 { | 11 { |
| 12 if (msg.error) { | 12 if (msg.error) { |
| 13 InspectorTest.log(msg.error.message); | 13 InspectorTest.log(msg.error.message); |
| 14 InspectorTest.completeTest(); | 14 InspectorTest.completeTest(); |
| 15 return; | 15 return; |
| 16 } | 16 } |
| 17 var rootNode = msg.result.root; | 17 var rootNode = msg.result.root; |
| 18 InspectorTest.sendCommand("DOM.querySelector", { "nodeId": rootNode.node
Id, "selector": "head" }, onQuerySelector); | 18 InspectorTest.sendCommand("DOM.querySelector", { "nodeId": rootNode.node
Id, "selector": "head" }, onQuerySelector); |
| 19 } | 19 } |
| 20 | 20 |
| 21 function onQuerySelector(msg) | 21 function onQuerySelector(msg) |
| 22 { | 22 { |
| 23 if (msg.error) { | 23 if (msg.error) { |
| 24 InspectorTest.log(msg.error.message); | 24 InspectorTest.log(msg.error.message); |
| 25 InspectorTest.completeTest(); | 25 InspectorTest.completeTest(); |
| 26 return; | 26 return; |
| 27 } | 27 } |
| 28 var node = msg.result; | 28 var node = msg.result; |
| 29 InspectorTest.sendCommand("Accessibility.getAXNode", { "nodeId": node.no
deId }, onGotAccessibilityNode); | 29 InspectorTest.sendCommand("Accessibility.getAXNodeChain", { "nodeId": no
de.nodeId, "fetchAncestors": false }, onGotAccessibilityNode); |
| 30 } | 30 } |
| 31 | 31 |
| 32 function onGotAccessibilityNode(msg) | 32 function onGotAccessibilityNode(msg) |
| 33 { | 33 { |
| 34 if (msg.error) { | 34 if (msg.error) { |
| 35 InspectorTest.log(msg.error.message); | 35 InspectorTest.log(msg.error.message); |
| 36 InspectorTest.completeTest(); | 36 InspectorTest.completeTest(); |
| 37 return; | 37 return; |
| 38 } | 38 } |
| 39 | 39 |
| 40 // nodeId isn't always the same, so set it to a known value if it's pres
ent | |
| 41 InspectorTest.log('result: ' + JSON.stringify(msg.result, null, " ")); | 40 InspectorTest.log('result: ' + JSON.stringify(msg.result, null, " ")); |
| 42 InspectorTest.completeTest(); | 41 InspectorTest.completeTest(); |
| 43 } | 42 } |
| 44 } | 43 } |
| 45 | 44 |
| 46 </script> | 45 </script> |
| 47 </head> | 46 </head> |
| 48 <body onLoad="runTest();"> | 47 <body onLoad="runTest();"> |
| 49 <input type="text"></input> | 48 <input type="text"></input> |
| 50 </body> | 49 </body> |
| 51 </html> | 50 </html> |
| OLD | NEW |