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

Unified Diff: test/inspector/debugger/scope-skip-variables-with-empty-name.js

Issue 2369753004: [inspector] added inspector test runner [part 5] (Closed)
Patch Set: addressed comments Created 4 years, 3 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/debugger/scope-skip-variables-with-empty-name.js
diff --git a/test/inspector/debugger/scope-skip-variables-with-empty-name.js b/test/inspector/debugger/scope-skip-variables-with-empty-name.js
new file mode 100644
index 0000000000000000000000000000000000000000..e29bf4b2315054a11be6df1c921976761dd34fa8
--- /dev/null
+++ b/test/inspector/debugger/scope-skip-variables-with-empty-name.js
@@ -0,0 +1,42 @@
+// 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.
+
+InspectorTest.evaluateInPage(
+`function testFunction()
+{
+ for (var a of [1]) {
+ ++a;
+ debugger;
+ }
+}`);
+
+InspectorTest.sendCommandOrDie("Debugger.enable", {});
+InspectorTest.eventHandler["Debugger.paused"] = dumpScopeOnPause;
+InspectorTest.sendCommandOrDie("Runtime.evaluate", { "expression": "testFunction()" });
+
+var waitScopeObjects = 0;
+function dumpScopeOnPause(message)
+{
+ var scopeChain = message.params.callFrames[0].scopeChain;
+ var localScopeObjectIds = [];
+ for (var scope of scopeChain) {
+ if (scope.type === "local")
+ localScopeObjectIds.push(scope.object.objectId);
+ }
+ waitScopeObjects = localScopeObjectIds.length;
+ if (!waitScopeObjects) {
+ InspectorTest.completeTest();
+ } else {
+ for (var objectId of localScopeObjectIds)
+ InspectorTest.sendCommandOrDie("Runtime.getProperties", { "objectId" : objectId }, dumpProperties);
+ }
+}
+
+function dumpProperties(message)
+{
+ InspectorTest.logObject(message);
+ --waitScopeObjects;
+ if (!waitScopeObjects)
+ InspectorTest.sendCommandOrDie("Debugger.resume", {}, () => InspectorTest.completeTest());
+}

Powered by Google App Engine
This is Rietveld 408576698