Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Side by Side Diff: LayoutTests/inspector/console/console-native-function-to-string.html

Issue 189723004: DevTools: console evaluation should work when window.console is overriden. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/inspector/console/console-substituted.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector/console/console-substituted.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698