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

Side by Side Diff: test/inspector/runtime/length-or-size-description.js

Issue 2770583002: [inspector] description for weak collections should not contain size (Closed)
Patch Set: added to protocol Created 3 years, 9 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("Test that descriptions for arrays, maps, and sets include the correct length or size.") 5 InspectorTest.log("Test that descriptions for arrays, maps, and sets include the correct length or size.")
6 6
7 Promise.all([ 7 Promise.all([
8 testExpression("new Set()"), 8 testExpression("new Set()"),
9 testExpression("new Set([1,2])"), 9 testExpression("new Set([1,2])"),
10 testExpression("new Map()"), 10 testExpression("new Map()"),
11 testExpression("new Map([[1,2],[3,4]])"), 11 testExpression("new Map([[1,2],[3,4]])"),
12 testExpression("new Array()"), 12 testExpression("new Array()"),
13 testExpression("new Array(2)"), 13 testExpression("new Array(2)"),
14 testExpression("new Uint8Array()"), 14 testExpression("new Uint8Array()"),
15 testExpression("new Uint8Array(2)") 15 testExpression("new Uint8Array(2)"),
16 // WeakMap and WeakSet should not have size in description.
17 testExpression("new WeakMap([[{}, 42]])"),
18 testExpression("new WeakSet([{}])")
16 ]).then(() => InspectorTest.completeTest()); 19 ]).then(() => InspectorTest.completeTest());
17 20
18 function testExpression(expression) { 21 function testExpression(expression) {
19 return Protocol.Runtime.evaluate({ expression: expression }) 22 return Protocol.Runtime.evaluate({ expression: expression })
20 .then(result => InspectorTest.logMessage(result.result.result.descri ption)) 23 .then(result => InspectorTest.logMessage(result.result.result.descri ption))
21 .then(() => Protocol.Runtime.evaluate({ expression: "[" + expression + "]", generatePreview: true })) 24 .then(() => Protocol.Runtime.evaluate({ expression: "[" + expression + "]", generatePreview: true }))
22 .then(result => InspectorTest.logMessage(result.result.result.previe w.properties[0].value)) 25 .then(result => InspectorTest.logMessage(result.result.result.previe w.properties[0].value))
23 } 26 }
OLDNEW
« no previous file with comments | « src/inspector/v8-injected-script-host.cc ('k') | test/inspector/runtime/length-or-size-description-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698