Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 print("Tests that Runtime.evaluate will generate correct previews."); | |
| 6 | |
| 7 InspectorTest.addScript( | |
| 8 ` | |
| 9 Object.prototype[0] = 'default-first'; | |
| 10 var obj = {p1: {a:1}, p2: {b:'foo'}}; | |
| 11 Object.defineProperty(obj, 1, { | |
| 12 get() { return 2 } | |
| 13 }); | |
| 14 | |
| 15 Array.prototype[0] = 'default-first'; | |
| 16 var arr = [,, 1, [2]]; | |
| 17 Object.defineProperty(arr, 1, { | |
|
dgozman
2016/11/24 00:33:32
Let's add a property with only a setter, and with
luoe
2016/12/02 00:14:33
Done.
| |
| 18 get() { return 2 } | |
| 19 }); | |
| 20 `); | |
| 21 | |
| 22 InspectorTest.runTestSuite([ | |
| 23 function testObjectPropertiesPreview(next) | |
| 24 { | |
| 25 Protocol.Runtime.evaluate({ "expression": "obj", "generatePreview": true }) | |
| 26 .then(result => InspectorTest.logMessage(result.result.result.preview)) | |
| 27 .then(next); | |
| 28 }, | |
| 29 | |
| 30 function testArrayPropertiesPreview(next) | |
| 31 { | |
| 32 Protocol.Runtime.evaluate({ "expression": "arr", "generatePreview": true }) | |
| 33 .then(result => InspectorTest.logMessage(result.result.result.preview)) | |
| 34 .then(next); | |
| 35 } | |
| 36 ]); | |
| OLD | NEW |