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

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

Issue 2605693003: DevTools: introduce object previews experiment (Closed)
Patch Set: rebase Created 3 years, 10 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
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 5
6 <script> 6 <script>
7 // Global Values 7 // Global Values
8 var globals = []; 8 var globals = [];
9 9
10 function log(current) 10 function log(current)
11 { 11 {
12 console.log(globals[current]); 12 console.log(globals[current]);
13 console.log([globals[current]]); 13 console.log([globals[current]]);
14 } 14 }
15 15
16 function onload() 16 function onload()
17 { 17 {
18 var foo = { foo: "foo"}; 18 var foo = { foo: "foo"};
19 var bar = { bar: "bar" }; 19 var bar = { bar: "bar" };
20 bar.__proto__ = foo; 20 bar.__proto__ = foo;
21 var singleArray = ["test"];
21 var array = ["test", "test2"]; array.length = 10; 22 var array = ["test", "test2"]; array.length = 10;
22 array.foo = {}; 23 array.foo = {};
23 array[4] = "test4"; 24 array[4] = "test4";
24 25
25 var svg = document.getElementById("svg-node"); 26 var svg = document.getElementById("svg-node");
26 console.log(array); 27 console.log(array);
27 console.log("%o", array); 28 console.log("%o", array);
28 console.log("%O", array); 29 console.log("%O", array);
29 console.log("Test for zero \"%f\" in formatter", 0); 30 console.log("Test for zero \"%f\" in formatter", 0);
30 console.log("%% self-escape1", "dummy"); 31 console.log("%% self-escape1", "dummy");
(...skipping 29 matching lines...) Expand all
60 getFoo: { value: function() { return this.foo; } }, 61 getFoo: { value: function() { return this.foo; } },
61 bar: { get: function() { return this.bar; }, set: function(x) { this.bar = x; } } 62 bar: { get: function() { return this.bar; }, set: function(x) { this.bar = x; } }
62 }); 63 });
63 objectWithNonEnumerables.enumerableProp = 4; 64 objectWithNonEnumerables.enumerableProp = 4;
64 objectWithNonEnumerables.__underscoreEnumerableProp__ = 5; 65 objectWithNonEnumerables.__underscoreEnumerableProp__ = 5;
65 var negZero = 1 / Number.NEGATIVE_INFINITY; 66 var negZero = 1 / Number.NEGATIVE_INFINITY;
66 var textNode = document.getElementById("x").nextSibling; 67 var textNode = document.getElementById("x").nextSibling;
67 var arrayLikeFunction = function( /**/ foo/**/, /*/**/bar, 68 var arrayLikeFunction = function( /**/ foo/**/, /*/**/bar,
68 /**/baz) {}; 69 /**/baz) {};
69 arrayLikeFunction.splice = function() {}; 70 arrayLikeFunction.splice = function() {};
71 var tinyTypedArray = new Uint8Array([3]);
70 var smallTypedArray = new Uint8Array(new ArrayBuffer(400)); 72 var smallTypedArray = new Uint8Array(new ArrayBuffer(400));
71 smallTypedArray["foo"] = "bar"; 73 smallTypedArray["foo"] = "bar";
72 var bigTypedArray = new Uint8Array(new ArrayBuffer(400 * 1000 * 1000)); 74 var bigTypedArray = new Uint8Array(new ArrayBuffer(400 * 1000 * 1000));
73 bigTypedArray["FAIL"] = "FAIL: Object.getOwnPropertyNames() should not have been run"; 75 bigTypedArray["FAIL"] = "FAIL: Object.getOwnPropertyNames() should not have been run";
74 var namespace = {}; 76 var namespace = {};
75 namespace.longSubNamespace = {}; 77 namespace.longSubNamespace = {};
76 namespace.longSubNamespace.x = {}; 78 namespace.longSubNamespace.x = {};
77 namespace.longSubNamespace.x.className = function(){}; 79 namespace.longSubNamespace.x.className = function(){};
78 var instanceWithLongClassName = new namespace.longSubNamespace.x.className() ; 80 var instanceWithLongClassName = new namespace.longSubNamespace.x.className() ;
79 var bigArray = []; 81 var bigArray = [];
80 bigArray.length = 200; 82 bigArray.length = 200;
81 bigArray.fill(1); 83 bigArray.fill(1);
82 globals = [ 84 globals = [
83 regex1, regex2, str, str2, error, errorWithMessage, errorWithMultilineMe ssage, node, func, multilinefunc, 85 regex1, regex2, str, str2, error, errorWithMessage, errorWithMultilineMe ssage, node, func, multilinefunc,
84 num, linkify, null, undefined, valuelessAttribute, valuedAttribute, exis tingAttribute, throwingLengthGetter, 86 num, linkify, null, undefined, valuelessAttribute, valuedAttribute, exis tingAttribute, throwingLengthGetter,
85 NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY, array, {}, [fun ction() {}], bar, svg, 87 NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY, array, {}, [fun ction() {}], bar, svg,
86 objectWithNonEnumerables, negZero, Object.create(null), Object, Object.p rototype, arrayLikeFunction, 88 objectWithNonEnumerables, negZero, Object.create(null), Object, Object.p rototype, arrayLikeFunction,
87 new Number(42), new String("abc"), new Uint16Array([1, 2, 3]), textNode, domException(), 89 new Number(42), new String("abc"), new Uint16Array([1, 2, 3]), textNode, domException(),
88 smallTypedArray, bigTypedArray, instanceWithLongClassName, bigArray 90 tinyTypedArray, smallTypedArray, bigTypedArray, instanceWithLongClassNam e, bigArray, singleArray
89 ]; 91 ];
90 92
91 runTest(); 93 runTest();
92 } 94 }
93 95
94 function domException() 96 function domException()
95 { 97 {
96 var result = "FAIL"; 98 var result = "FAIL";
97 try { 99 try {
98 var a = document.createElement("div"); 100 var a = document.createElement("div");
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 } 150 }
149 </script> 151 </script>
150 </head> 152 </head>
151 153
152 <body onload="onload()"> 154 <body onload="onload()">
153 <div id="x"></div> 155 <div id="x"></div>
154 <p id="p">Tests that console logging dumps proper messages.</p> 156 <p id="p">Tests that console logging dumps proper messages.</p>
155 </body> 157 </body>
156 <svg id="svg-node"></svg> 158 <svg id="svg-node"></svg>
157 </html> 159 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698