Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / console / console-native-function-to-string.html
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/console-test.js"></script>
5 <script>
6
7 function rightPadding(str, minLength)
8 {
9     str += Array(minLength).join(" ");
10     return str.substr(0, minLength) + str.substr(minLength).trim();
11 }
12
13 function test()
14 {
15     function printCommandLineAPI()
16     {
17         var properties = [];
18         for (var p in __commandLineAPI) {
19             if (/^\$(_|\d+)$/.test(p))
20                 continue;
21             properties.push(p);
22         }
23         properties.sort();
24         var msgs = [];
25         properties.forEach(function(p) {
26             msgs.push(rightPadding(p, 20) + ": " + eval(p));
27         });
28         output("CommandLineAPI\n\n"+ msgs.join("\n"));
29     }
30
31     InspectorTest.evaluateInConsole("(" + printCommandLineAPI + ")()");
32     InspectorTest.completeTest();
33 }
34
35 </script>
36 </head>
37 <body onload="runTest()">
38     <p>Tests that command-line API methods behave similarly to native code by returning '[Command Line API]' via toString().</p>
39 </body>
40 </html>