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

Unified Diff: test/inspector/runtime/internal-properties.js

Issue 2672213002: [inspector] introduced v8::debug::EntriesPreview for inspector (Closed)
Patch Set: addressed comments 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 side-by-side diff with in-line comments
Download patch
Index: test/inspector/runtime/internal-properties.js
diff --git a/test/inspector/runtime/internal-properties.js b/test/inspector/runtime/internal-properties.js
new file mode 100644
index 0000000000000000000000000000000000000000..dd7581654d805fbd0f1e272b8f3bf55a60842ef5
--- /dev/null
+++ b/test/inspector/runtime/internal-properties.js
@@ -0,0 +1,52 @@
+// Copyright 2017 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('Checks internal properties in Runtime.getProperties output');
+
+Protocol.Runtime.enable();
+Protocol.Debugger.enable();
+
+InspectorTest.runTestSuite([
+ function generatorFunction(next) {
+ checkExpression('(function* foo() { yield 1 })').then(next);
+ },
+
+ function regularFunction(next) {
+ checkExpression('(function foo() {})').then(next);
+ },
+
+ function boxedObjects(next) {
+ checkExpression('new Number(239)')
+ .then(() => checkExpression('new Boolean(false)'))
+ .then(() => checkExpression('new String(\'abc\')'))
+ .then(() => checkExpression('Object(Symbol(42))'))
+ .then(next);
+ },
+
+ function promise(next) {
+ checkExpression('Promise.resolve(42)')
+ .then(() => checkExpression('new Promise(() => undefined)'))
+ .then(next);
+ },
+
+ function generatorObject(next) {
+ checkExpression('(function* foo() { yield 1 })()')
+ .then(next);
+ },
+
+ function iteratorObject(next) {
+ checkExpression('(new Map([[1,2]])).entries()')
+ .then(() => checkExpression('(new Set([[1,2]])).entries()'))
+ .then(next);
+ }
+]);
+
+function checkExpression(expression)
+{
+ InspectorTest.log(`expression: ${expression}`);
+ return Protocol.Runtime.evaluate({ expression: expression })
+ .then(message => Protocol.Runtime.getProperties({ objectId: message.result.result.objectId }))
+ .then(message => { delete message.result.result; return message; })
+ .then(InspectorTest.logMessage);
+}

Powered by Google App Engine
This is Rietveld 408576698