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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/console/console-log-object-with-getter.html

Issue 2606733003: DevTools: clean up ObjectPropertiesSection.createValueElement (Closed)
Patch Set: ac Created 3 years, 11 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 <script> 5 <script>
6 var obj = {} 6 var obj = {}
7 Object.defineProperty(obj, 'foo', {enumerable: true, get: function() { return {a :1,b:2}; }}); 7 Object.defineProperty(obj, 'foo', {enumerable: true, get: function() { return {a :1,b:2}; }});
8 Object.defineProperty(obj, 'bar', {enumerable: false, set: function(x) { this.ba z = x; }}); 8 Object.defineProperty(obj, 'bar', {enumerable: false, set: function(x) { this.ba z = x; }});
9 9
10 var arr = []; 10 var arr = [];
11 Object.defineProperty(arr, 0, {enumerable: true, get: function() { return 1; }}) ; 11 Object.defineProperty(arr, 0, {enumerable: true, get: function() { return 1; }}) ;
12 Object.defineProperty(arr, 1, {enumerable: false, set: function(x) { this.baz = x; }}); 12 Object.defineProperty(arr, 1, {enumerable: false, set: function(x) { this.baz = x; }});
13
14 var objWithGetterExceptions = {
15 get error() { throw new Error('myError') },
16 get string() { throw 'myString' },
17 get number() { throw 123 },
18 get function() { throw function() {} },
19 };
20
13 function logObject() 21 function logObject()
14 { 22 {
15 console.log(obj); 23 console.log(obj);
16 console.log(arr); 24 console.log(arr);
25 console.log(objWithGetterExceptions);
17 } 26 }
18 27
19 function test() 28 function test()
20 { 29 {
21 InspectorTest.evaluateInPage("logObject()", step2); 30 InspectorTest.evaluateInPage("logObject()", step2);
22 function step2() 31 function step2()
23 { 32 {
24 InspectorTest.dumpConsoleMessages(); 33 InspectorTest.dumpConsoleMessages();
25 step3(); 34 step3();
26 } 35 }
27 function step3() 36 function step3()
28 { 37 {
29 InspectorTest.expandConsoleMessages(step4); 38 InspectorTest.expandConsoleMessages(step4);
30 } 39 }
31 function step4() 40 function step4()
32 { 41 {
33 InspectorTest.expandGettersInConsoleMessages(step5); 42 InspectorTest.expandGettersInConsoleMessages(step5);
34 } 43 }
35 function step5() 44 function step5()
36 { 45 {
37 InspectorTest.dumpConsoleMessages(); 46 InspectorTest.dumpConsoleMessages(false, true);
38 InspectorTest.completeTest(); 47 InspectorTest.completeTest();
39 } 48 }
40 } 49 }
41 </script> 50 </script>
42 </head> 51 </head>
43 52
44 <body onload="runTest()"> 53 <body onload="runTest()">
45 <p> 54 <p>
46 Tests that console logging dumps object values defined by getters and allows to expand it. 55 Tests that console logging dumps object values defined by getters and allows to expand it.
47 </p> 56 </p>
48 </body> 57 </body>
49 </html> 58 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698