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

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

Issue 3302012: Move stack check after while statement. (Closed)
Patch Set: Created 10 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
« no previous file with comments | « src/full-codegen.cc ('k') | no next file » | 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 9531b5720b9ef6e017432f34d7cf9dfb0529b637..f5526cea9859620d71ce6623484240af3e2959da 100644
--- a/test/cctest/test-debug.cc
+++ b/test/cctest/test-debug.cc
@@ -4591,6 +4591,18 @@ int GetTotalFramesInt(char *message) {
}
+// We match parts of the message to get source line.
+int GetSourceLineFromBreakEventMessage(char *message) {
+ const char* source_line = "\"sourceLine\":";
+ char* pos = strstr(message, source_line);
+ if (pos == NULL) {
+ return -1;
+ }
+ int res = -1;
+ res = StringToInt(pos + strlen(source_line));
+ return res;
+}
+
/* Test MessageQueues */
/* Tests the message queues that hold debugger commands and
* response messages to the debugger. Fills queues and makes
@@ -4870,6 +4882,9 @@ static void ThreadedMessageHandler(const v8::Debug::Message& message) {
v8::String::Value json(message.GetJSON());
Utf16ToAscii(*json, json.length(), print_buffer);
if (IsBreakEventMessage(print_buffer)) {
+ // Check that we are inside the while loop.
+ int source_line = GetSourceLineFromBreakEventMessage(print_buffer);
+ CHECK(8 <= source_line && source_line <= 13);
threaded_debugging_barriers.barrier_2.Wait();
}
}
« no previous file with comments | « src/full-codegen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698