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

Side by Side Diff: test/inspector/runtime/evaluate-with-generate-preview.js

Issue 2891213002: [inspector] Refactor protocol-test.js (Closed)
Patch Set: comments addressed Created 3 years, 7 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 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 InspectorTest.log("Tests that Runtime.evaluate will generate correct previews.") ; 5 let {session, contextGroup, Protocol} = InspectorTest.start("Tests that Runtime. evaluate will generate correct previews.");
6 6
7 InspectorTest.addScript( 7 contextGroup.addScript(
8 ` 8 `
9 var f1 = function(){}; 9 var f1 = function(){};
10 10
11 Object.prototype[0] = 'default-first'; 11 Object.prototype[0] = 'default-first';
12 var obj = {p1: {a:1}, p2: {b:'foo'}, p3: f1}; 12 var obj = {p1: {a:1}, p2: {b:'foo'}, p3: f1};
13 Object.defineProperties(obj, { 13 Object.defineProperties(obj, {
14 p4: { 14 p4: {
15 get() { return 2 } 15 get() { return 2 }
16 }, 16 },
17 p5: { 17 p5: {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 var deterministicNativeFunction = Math.log; 58 var deterministicNativeFunction = Math.log;
59 var parentObj = {}; 59 var parentObj = {};
60 Object.defineProperty(parentObj, 'propNotNamedProto', { 60 Object.defineProperty(parentObj, 'propNotNamedProto', {
61 get: deterministicNativeFunction, 61 get: deterministicNativeFunction,
62 set: function() {} 62 set: function() {}
63 }); 63 });
64 var objInheritsGetterProperty = {__proto__: parentObj}; 64 var objInheritsGetterProperty = {__proto__: parentObj};
65 inspector.allowAccessorFormatting(objInheritsGetterProperty); 65 inspector.allowAccessorFormatting(objInheritsGetterProperty);
66 `); 66 `);
67 67
68 InspectorTest.setupInjectedScriptEnvironment(); 68 contextGroup.setupInjectedScriptEnvironment();
69 69
70 InspectorTest.runTestSuite([ 70 InspectorTest.runTestSuite([
71 function testObjectPropertiesPreview(next) 71 function testObjectPropertiesPreview(next)
72 { 72 {
73 Protocol.Runtime.evaluate({ "expression": "obj", "generatePreview": true }) 73 Protocol.Runtime.evaluate({ "expression": "obj", "generatePreview": true })
74 .then(result => InspectorTest.logMessage(result.result.result.preview)) 74 .then(result => InspectorTest.logMessage(result.result.result.preview))
75 .then(next); 75 .then(next);
76 }, 76 },
77 77
78 function testArrayPropertiesPreview(next) 78 function testArrayPropertiesPreview(next)
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 .then(next); 138 .then(next);
139 }, 139 },
140 140
141 function testObjWithArrayAsProto(next) 141 function testObjWithArrayAsProto(next)
142 { 142 {
143 Protocol.Runtime.evaluate({ "expression": "Object.create([1,2])", "generateP review": true }) 143 Protocol.Runtime.evaluate({ "expression": "Object.create([1,2])", "generateP review": true })
144 .then(result => InspectorTest.logMessage(result.result.result.preview)) 144 .then(result => InspectorTest.logMessage(result.result.result.preview))
145 .then(next); 145 .then(next);
146 } 146 }
147 ]); 147 ]);
OLDNEW
« no previous file with comments | « test/inspector/runtime/evaluate-with-context-id-equal-zero-expected.txt ('k') | test/inspector/runtime/exception-thrown.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698