Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / console / console-native-function-to-string.html
blob84bf83c3b8b3dcd5820b0e6dfacde6e36100c219
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>
7 function rightPadding(str, minLength)
9 str += Array(minLength).join(" ");
10 return str.substr(0, minLength) + str.substr(minLength).trim();
13 function test()
15 function printCommandLineAPI()
17 var properties = [];
18 for (var p in __commandLineAPI) {
19 if (/^\$(_|\d+)$/.test(p))
20 continue;
21 properties.push(p);
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"));
31 InspectorTest.evaluateInConsole("(" + printCommandLineAPI + ")()");
32 InspectorTest.completeTest();
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>