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 rightPadding(str, minLength) | 6 function rightPadding(str, minLength) |
7 { | 7 { |
8 str += Array(minLength).join(" "); | 8 str += Array(minLength).join(" "); |
9 return str.substr(0, minLength) + str.substr(minLength).trim(); | 9 return str.substr(0, minLength) + str.substr(minLength).trim(); |
10 } | 10 } |
11 | 11 |
12 function test() | 12 function test() |
13 { | 13 { |
14 function printCommandLineAPI() | 14 function printCommandLineAPI() |
15 { | 15 { |
16 var properties = []; | 16 var properties = []; |
17 for (var p in console._commandLineAPI) { | 17 for (var p in __commandLineAPI) { |
18 if (/^\$(_|\d+)$/.test(p)) | 18 if (/^\$(_|\d+)$/.test(p)) |
19 continue; | 19 continue; |
20 properties.push(p); | 20 properties.push(p); |
21 } | 21 } |
22 properties.sort(); | 22 properties.sort(); |
23 var msgs = []; | 23 var msgs = []; |
24 properties.forEach(function(p) { | 24 properties.forEach(function(p) { |
25 msgs.push(rightPadding(p, 20) + ": " + eval(p)); | 25 msgs.push(rightPadding(p, 20) + ": " + eval(p)); |
26 }); | 26 }); |
27 output("CommandLineAPI\n\n"+ msgs.join("\n")); | 27 output("CommandLineAPI\n\n"+ msgs.join("\n")); |
28 } | 28 } |
29 | 29 |
30 InspectorTest.evaluateInConsole("(" + printCommandLineAPI + ")()"); | 30 InspectorTest.evaluateInConsole("(" + printCommandLineAPI + ")()"); |
31 InspectorTest.completeTest(); | 31 InspectorTest.completeTest(); |
32 } | 32 } |
33 | 33 |
34 </script> | 34 </script> |
35 </head> | 35 </head> |
36 <body onload="runTest()"> | 36 <body onload="runTest()"> |
37 <p>Tests that command-line API methods behave similarly to native code by re
turning '[Command Line API]' via toString().</p> | 37 <p>Tests that command-line API methods behave similarly to native code by re
turning '[Command Line API]' via toString().</p> |
38 </body> | 38 </body> |
39 </html> | 39 </html> |
OLD | NEW |