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

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

Issue 2508423002: Add getter properties to array entry previews (Closed)
Patch Set: rebase Created 4 years 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
(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.defineProperties(obj, {
12 p3: {
13 get() { return 2 }
14 },
15 p4: {
16 set(x) { return x }
17 },
18 p5: {
19 get() { return 2 },
20 set(x) { return x }
21 }
22 });
23
24 Array.prototype[0] = 'default-first';
25 var arr = [,, 1, [2]];
26 Object.defineProperties(arr, {
27 4: {
28 get() { return 2 }
29 },
30 5: {
31 set(x) { return x }
32 },
33 6: {
34 get() { return 2 },
35 set(x) { return x }
36 }
37 });
38 `);
39
40 InspectorTest.runTestSuite([
41 function testObjectPropertiesPreview(next)
42 {
43 Protocol.Runtime.evaluate({ "expression": "obj", "generatePreview": true })
44 .then(result => InspectorTest.logMessage(result.result.result.preview))
45 .then(next);
46 },
47
48 function testArrayPropertiesPreview(next)
49 {
50 Protocol.Runtime.evaluate({ "expression": "arr", "generatePreview": true })
51 .then(result => InspectorTest.logMessage(result.result.result.preview))
52 .then(next);
53 }
54 ]);
OLDNEW
« no previous file with comments | « src/inspector/injected-script-source.js ('k') | test/inspector/runtime/evaluate-with-generate-preview-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698