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