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

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: Minor nits 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
Index: test/cctest/test-debug.cc
diff --git a/test/cctest/test-debug.cc b/test/cctest/test-debug.cc
index 7aad65360cc1684f610575f5dc8e0bda1cf89a6f..91373402ba049ad2867e94c0b9e9f28feea4f391 100644
--- a/test/cctest/test-debug.cc
+++ b/test/cctest/test-debug.cc
@@ -7631,8 +7631,32 @@ static void DebugHarmonyScopingListener(
i::Vector<char> script_vector(script, sizeof(script));
SNPrintF(script_vector, "%%GetFrameCount(%d)", break_id);
v8::Local<v8::Value> result = CompileRun(script);
+ CHECK_EQ(1, result->Int32Value());
aandrey 2014/11/14 15:58:47 nit: you can use ExpectInt32() here and below
Dmitry Lomov (no reviews) 2014/11/14 16:37:26 Done.
+
+ SNPrintF(script_vector, "var frame = new FrameMirror(%d, 0);", break_id);
+ CompileRun(script);
+ result = CompileRun("frame.evaluate('x').value_");
+ CHECK_EQ(1, result->Int32Value());
+ result = CompileRun("frame.evaluate('y').value_");
+ CHECK_EQ(2, result->Int32Value());
+
+ CompileRun("var allScopes = frame.allScopes()");
+ result = CompileRun("allScopes.length");
+ CHECK_EQ(2, result->Int32Value());
+ result = CompileRun("allScopes[0].scopeType() === ScopeType.Script");
+ CHECK(result->IsTrue());
+
+ result = CompileRun("allScopes[0].scopeObject().value_.x");
CHECK_EQ(1, result->Int32Value());
+
+ result = CompileRun("allScopes[0].scopeObject().value_.y");
+ CHECK_EQ(2, result->Int32Value());
+
+ CompileRun("allScopes[0].setVariableValue('x', 5);");
+ CompileRun("allScopes[0].setVariableValue('y', 6);");
+ result = CompileRun("frame.evaluate('x + y').value_");
+ CHECK_EQ(11, result->Int32Value());
}
@@ -7648,8 +7672,16 @@ TEST(DebugBreakInLexicalScopes) {
CompileRun(
"'use strict'; \n"
"let x = 1; \n");
- CompileRun(
+ v8::Local<v8::Value> result = CompileRun(
"'use strict'; \n"
- "let y = 1; \n"
- "debugger \n");
+ "let y = 2; \n"
+ "debugger; \n"
+ "x * y");
+ CHECK_EQ(30, result->Int32Value());
+
+ result = CompileRun(
+ "x = 1; y = 2; \n"
+ "debugger;"
+ "x * y");
+ CHECK_EQ(30, result->Int32Value());
}

Powered by Google App Engine
This is Rietveld 408576698