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

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

Issue 2705533002: [inspector] remove iterators and for...of loops from injected-script-source (Closed)
Patch Set: ac 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 // 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 print("Tests that Runtime.evaluate will generate correct previews."); 5 print("Tests that Runtime.evaluate will generate correct previews.");
6 6
7 InspectorTest.addScript( 7 InspectorTest.addScript(
8 ` 8 `
9 var f1 = function(){}; 9 var f1 = function(){};
10 10
(...skipping 25 matching lines...) Expand all
36 get() { return 2 }, 36 get() { return 2 },
37 set(x) { return x } 37 set(x) { return x }
38 } 38 }
39 }); 39 });
40 arr.nonEntryFunction = f1; 40 arr.nonEntryFunction = f1;
41 41
42 var inheritingObj = {}; 42 var inheritingObj = {};
43 var inheritingArr = []; 43 var inheritingArr = [];
44 inheritingObj.prototype = obj; 44 inheritingObj.prototype = obj;
45 inheritingArr.prototype = arr; 45 inheritingArr.prototype = arr;
46
47 var shortTypedArray = new Uint8Array(3);
48 var longTypedArray = new Uint8Array(50001);
49 var set = new Set([1, 2, 3]);
50 var bigSet = new Set();
51 var mixedSet = new Set();
52 for (var i = 0; i < 10; i++) {
53 bigSet.add(i);
54 mixedSet["_prop_" + i] = 1;
55 mixedSet.add(i);
56 }
46 `); 57 `);
47 58
48 InspectorTest.runTestSuite([ 59 InspectorTest.runTestSuite([
49 function testObjectPropertiesPreview(next) 60 function testObjectPropertiesPreview(next)
50 { 61 {
51 Protocol.Runtime.evaluate({ "expression": "obj", "generatePreview": true }) 62 Protocol.Runtime.evaluate({ "expression": "obj", "generatePreview": true })
52 .then(result => InspectorTest.logMessage(result.result.result.preview)) 63 .then(result => InspectorTest.logMessage(result.result.result.preview))
53 .then(next); 64 .then(next);
54 }, 65 },
55 66
56 function testArrayPropertiesPreview(next) 67 function testArrayPropertiesPreview(next)
57 { 68 {
58 Protocol.Runtime.evaluate({ "expression": "arr", "generatePreview": true }) 69 Protocol.Runtime.evaluate({ "expression": "arr", "generatePreview": true })
59 .then(result => InspectorTest.logMessage(result.result.result.preview)) 70 .then(result => InspectorTest.logMessage(result.result.result.preview))
60 .then(next); 71 .then(next);
61 }, 72 },
62 73
63 function testInheritingObjectPropertiesPreview(next) 74 function testInheritingObjectPropertiesPreview(next)
64 { 75 {
65 Protocol.Runtime.evaluate({ "expression": "inheritingObj", "generatePreview" : true }) 76 Protocol.Runtime.evaluate({ "expression": "inheritingObj", "generatePreview" : true })
66 .then(result => InspectorTest.logMessage(result.result.result.preview)) 77 .then(result => InspectorTest.logMessage(result.result.result.preview))
67 .then(next); 78 .then(next);
68 }, 79 },
69 80
70 function testInheritingArrayPropertiesPreview(next) 81 function testInheritingArrayPropertiesPreview(next)
71 { 82 {
72 Protocol.Runtime.evaluate({ "expression": "inheritingArr", "generatePreview" : true }) 83 Protocol.Runtime.evaluate({ "expression": "inheritingArr", "generatePreview" : true })
73 .then(result => InspectorTest.logMessage(result.result.result.preview)) 84 .then(result => InspectorTest.logMessage(result.result.result.preview))
74 .then(next); 85 .then(next);
86 },
87
88 function testShortTypedArrayPropertiesPreview(next)
89 {
90 Protocol.Runtime.evaluate({ "expression": "shortTypedArray", "generatePrevie w": true })
91 .then(result => InspectorTest.logMessage(result.result.result.preview))
92 .then(next);
93 },
94
95 function testLongTypedArrayPropertiesPreview(next)
96 {
97 Protocol.Runtime.evaluate({ "expression": "longTypedArray", "generatePreview ": true })
98 .then(result => InspectorTest.logMessage(result.result.result.preview))
99 .then(next);
100 },
101
102 function testSetPropertiesPreview(next)
103 {
104 Protocol.Runtime.evaluate({ "expression": "set", "generatePreview": true })
105 .then(result => InspectorTest.logMessage(result.result.result.preview))
106 .then(next);
107 },
108
109 function testBigSetPropertiesPreview(next)
110 {
111 Protocol.Runtime.evaluate({ "expression": "bigSet", "generatePreview": true })
112 .then(result => InspectorTest.logMessage(result.result.result.preview))
113 .then(next);
114 },
115
116 function testMixedSetPropertiesPreview(next)
117 {
118 Protocol.Runtime.evaluate({ "expression": "mixedSet", "generatePreview": tru e })
119 .then(result => InspectorTest.logMessage(result.result.result.preview))
120 .then(next);
75 } 121 }
76 ]); 122 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698