| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script> | 4 <script> |
| 5 | 5 |
| 6 function test() | 6 function test() |
| 7 { | 7 { |
| 8 InspectorTest.RuntimeAgent.evaluate("document.all", "console", false, didGet
HTMLAllCollection.bind(this)); | 8 InspectorTest.RuntimeAgent.evaluate("document.all", "console", false, didGet
HTMLAllCollection.bind(this)); |
| 9 function didGetHTMLAllCollection(error, result, wasThrown) | 9 function didGetHTMLAllCollection(error, result, wasThrown) |
| 10 { | 10 { |
| 11 if (error || wasThrown) { | 11 if (error || wasThrown) { |
| 12 InspectorTest.addResult("FAILED: " + error); | 12 InspectorTest.addResult("FAILED: " + error); |
| 13 InspectorTest.completeTest(); | 13 InspectorTest.completeTest(); |
| 14 return; | 14 return; |
| 15 } | 15 } |
| 16 var htmlAllCollection = WebInspector.runtimeModel.createRemoteObject(res
ult); | 16 var htmlAllCollection = InspectorTest.runtimeModel.createRemoteObject(re
sult); |
| 17 htmlAllCollection.callFunctionJSON("function(collection) { return this.l
ength + collection.length; }", [{objectId: htmlAllCollection.objectId}], didGetL
ength.bind(this)); | 17 htmlAllCollection.callFunctionJSON("function(collection) { return this.l
ength + collection.length; }", [{objectId: htmlAllCollection.objectId}], didGetL
ength.bind(this)); |
| 18 } | 18 } |
| 19 | 19 |
| 20 function didGetLength(len) | 20 function didGetLength(len) |
| 21 { | 21 { |
| 22 if (!len || typeof len !== "number") | 22 if (!len || typeof len !== "number") |
| 23 InspectorTest.addResult("FAILED: unexpected document.all.length: " +
len); | 23 InspectorTest.addResult("FAILED: unexpected document.all.length: " +
len); |
| 24 else | 24 else |
| 25 InspectorTest.addResult("PASSED: retrieved length of document.all"); | 25 InspectorTest.addResult("PASSED: retrieved length of document.all"); |
| 26 InspectorTest.completeTest(); | 26 InspectorTest.completeTest(); |
| 27 } | 27 } |
| 28 } | 28 } |
| 29 | 29 |
| 30 </script> | 30 </script> |
| 31 </head> | 31 </head> |
| 32 | 32 |
| 33 <body onload="runTest()"> | 33 <body onload="runTest()"> |
| 34 <p> | 34 <p> |
| 35 Tests that HTMLAllCollection properties can be inspected. | 35 Tests that HTMLAllCollection properties can be inspected. |
| 36 </p> | 36 </p> |
| 37 | 37 |
| 38 </body> | 38 </body> |
| 39 </html> | 39 </html> |
| OLD | NEW |