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

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

Issue 2521853003: Re-land of Use parenthesis in descriptions for array/map/set lengths/sizes (Closed)
Patch Set: ac Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: test/inspector/runtime/length-or-size-description.js
diff --git a/test/inspector/runtime/length-or-size-description.js b/test/inspector/runtime/length-or-size-description.js
new file mode 100644
index 0000000000000000000000000000000000000000..d7200f2cb8adb5abc2d439a56f4bfbff4c1fd003
--- /dev/null
+++ b/test/inspector/runtime/length-or-size-description.js
@@ -0,0 +1,22 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+print("Test that descriptions for arrays, maps, and sets include the correct length or size.")
+
+testExpression("new Set()")
kozy 2016/11/23 18:49:10 V8 run microtasks in the scheduled first - run fir
luoe 2016/11/23 19:23:31 Done.
+ .then(() => testExpression("new Set([1,2])"))
+ .then(() => testExpression("new Map()"))
+ .then(() => testExpression("new Map([[1,2],[3,4]])"))
+ .then(() => testExpression("new Array()"))
+ .then(() => testExpression("new Array(2)"))
+ .then(() => testExpression("new Uint8Array()"))
+ .then(() => testExpression("new Uint8Array(2)"))
+ .then(() => InspectorTest.completeTest());
+
+function testExpression(expression) {
+ return Protocol.Runtime.evaluate({ expression: expression })
+ .then(result => InspectorTest.logMessage(result.result.result.description))
+ .then(() => Protocol.Runtime.evaluate({ expression: "[" + expression + "]", generatePreview: true }))
+ .then(result => InspectorTest.logMessage(result.result.result.preview.properties[0].value))
+}

Powered by Google App Engine
This is Rietveld 408576698