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

Unified Diff: test/cctest/test-debug.cc

Issue 726643002: harmony-scoping: Implement debugger support for script scope. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Nit + rebased Created 6 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
« no previous file with comments | « src/runtime/runtime-debug.cc ('k') | test/mjsunit/debug-evaluate-locals-optimized.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-debug.cc
diff --git a/test/cctest/test-debug.cc b/test/cctest/test-debug.cc
index 7aad65360cc1684f610575f5dc8e0bda1cf89a6f..8061ee8bd055ef760809a9ce24b26e1b83d65e9d 100644
--- a/test/cctest/test-debug.cc
+++ b/test/cctest/test-debug.cc
@@ -7630,9 +7630,25 @@ static void DebugHarmonyScopingListener(
char script[128];
i::Vector<char> script_vector(script, sizeof(script));
SNPrintF(script_vector, "%%GetFrameCount(%d)", break_id);
- v8::Local<v8::Value> result = CompileRun(script);
+ ExpectInt32(script, 1);
+
+ SNPrintF(script_vector, "var frame = new FrameMirror(%d, 0);", break_id);
+ CompileRun(script);
+ ExpectInt32("frame.evaluate('x').value_", 1);
+ ExpectInt32("frame.evaluate('y').value_", 2);
+
+ CompileRun("var allScopes = frame.allScopes()");
+ ExpectInt32("allScopes.length", 2);
- CHECK_EQ(1, result->Int32Value());
+ ExpectBoolean("allScopes[0].scopeType() === ScopeType.Script", true);
+
+ ExpectInt32("allScopes[0].scopeObject().value_.x", 1);
+
+ ExpectInt32("allScopes[0].scopeObject().value_.y", 2);
+
+ CompileRun("allScopes[0].setVariableValue('x', 5);");
+ CompileRun("allScopes[0].setVariableValue('y', 6);");
+ ExpectInt32("frame.evaluate('x + y').value_", 11);
}
@@ -7648,8 +7664,15 @@ TEST(DebugBreakInLexicalScopes) {
CompileRun(
"'use strict'; \n"
"let x = 1; \n");
- CompileRun(
+ ExpectInt32(
"'use strict'; \n"
- "let y = 1; \n"
- "debugger \n");
+ "let y = 2; \n"
+ "debugger; \n"
+ "x * y",
+ 30);
+ ExpectInt32(
+ "x = 1; y = 2; \n"
+ "debugger;"
+ "x * y",
+ 30);
}
« no previous file with comments | « src/runtime/runtime-debug.cc ('k') | test/mjsunit/debug-evaluate-locals-optimized.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698