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

Side by Side Diff: LayoutTests/inspector/console/console-format-collections.html

Issue 197073004: DevTools: Fix wrong is-array-like detection when logging in console. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased 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
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 src="../../http/tests/inspector/console-test.js"></script> 4 <script src="../../http/tests/inspector/console-test.js"></script>
5 <script> 5 <script>
6 6
7 function logToConsole() 7 function logToConsole()
8 { 8 {
9 var formElement = document.getElementById("f"); 9 var formElement = document.getElementById("f");
10 var selectElement = document.getElementById("sel"); 10 var selectElement = document.getElementById("sel");
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 var nonArray = new NonArrayWithLength(); 43 var nonArray = new NonArrayWithLength();
44 console.log(nonArray); 44 console.log(nonArray);
45 45
46 // Arguments 46 // Arguments
47 function generateArguments(foo, bar) 47 function generateArguments(foo, bar)
48 { 48 {
49 return arguments; 49 return arguments;
50 } 50 }
51 console.log(generateArguments(1, "2")); 51 console.log(generateArguments(1, "2"));
52
53 // DOMTokenList
54 var div = document.getElementsByTagName("div")[0];
55 console.log(div.classList);
52 } 56 }
53 57
54 function onload() 58 function onload()
55 { 59 {
56 logToConsole(); 60 logToConsole();
57 runTest(); 61 runTest();
58 } 62 }
59 63
60 function NonArrayWithLength() 64 function NonArrayWithLength()
61 { 65 {
62 this.keys=[]; 66 this.keys = [];
63 } 67 }
64 68
65 NonArrayWithLength.prototype.__defineGetter__("length", function() 69 NonArrayWithLength.prototype.__defineGetter__("length", function()
66 { 70 {
67 console.log(".length should not be called"); 71 console.log("FAIL: 'length' should not be called");
68 return this.keys.length; 72 return this.keys.length;
69 }); 73 });
70 74
71 function test() 75 function test()
72 { 76 {
73 InspectorTest.evaluateInPage("logToConsole()", callback); 77 InspectorTest.evaluateInPage("logToConsole()", callback);
74 78
75 function callback() 79 function callback()
76 { 80 {
77 InspectorTest.dumpConsoleMessages(); 81 InspectorTest.dumpConsoleMessages();
78 InspectorTest.completeTest(); 82 InspectorTest.completeTest();
79 } 83 }
80 } 84 }
81 </script> 85 </script>
82 </head> 86 </head>
83 87
84 <body onload="onload()"> 88 <body onload="onload()">
85 <p> 89 <p>
86 Tests that console nicely formats HTML Collections and NodeLists. 90 Tests that console nicely formats HTML Collections, NodeLists and DOMTokenLists.
87 </p> 91 </p>
88 <div style="display:none"> 92 <div style="display:none" class="c1 c2 c3">
89 <form id="f"> 93 <form id="f">
90 <select id="sel" name="sel"> 94 <select id="sel" name="sel">
91 <option value="1">one</option> 95 <option value="1">one</option>
92 <option value="2">two</option> 96 <option value="2">two</option>
93 </select> 97 </select>
94 <input type="radio" name="x" value="x1" /> x1 98 <input type="radio" name="x" value="x1" /> x1
95 <input type="radio" name="x" value="x2" /> x2 99 <input type="radio" name="x" value="x2" /> x2
96 </form> 100 </form>
97 </div> 101 </div>
98 102
99 </body> 103 </body>
100 </html> 104 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698