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

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

Issue 67180: Add debug command break flag for debugger host dispatch (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 8 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/debug.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
===================================================================
--- test/cctest/test-debug.cc (revision 1707)
+++ test/cctest/test-debug.cc (working copy)
@@ -4025,19 +4025,33 @@
"\"type\":\"request\","
"\"command\":\"continue\"}";
+ // Create an empty function to call for processing debug commands
+ v8::Local<v8::Function> empty =
+ CompileFunction(&env, "function empty(){}", "empty");
+
// Setup message and host dispatch handlers.
v8::Debug::SetMessageHandler(DummyMessageHandler);
v8::Debug::SetHostDispatchHandler(HostDispatchHandlerHitCount,
NULL);
- // Fill a host dispatch and a continue command on the command queue before
- // running some code.
+ // Send a host dispatch by itself.
v8::Debug::SendHostDispatch(NULL);
+ empty->Call(env->Global(), 0, NULL); // Run JavaScript to activate debugger.
+ CHECK_EQ(1, host_dispatch_hit_count);
+
+ // Fill a host dispatch and a continue command on the command queue.
+ v8::Debug::SendHostDispatch(NULL);
v8::Debug::SendCommand(buffer, AsciiToUtf16(command_continue, buffer));
- CompileRun("void 0");
+ empty->Call(env->Global(), 0, NULL); // Run JavaScript to activate debugger.
- // The host dispatch callback should be called.
- CHECK_EQ(1, host_dispatch_hit_count);
+ // Fill a continue command and a host dispatch on the command queue.
+ v8::Debug::SendCommand(buffer, AsciiToUtf16(command_continue, buffer));
+ v8::Debug::SendHostDispatch(NULL);
+ empty->Call(env->Global(), 0, NULL); // Run JavaScript to activate debugger.
+ empty->Call(env->Global(), 0, NULL); // Run JavaScript to activate debugger.
+
+ // All the host dispatch callback should be called.
+ CHECK_EQ(3, host_dispatch_hit_count);
}
« no previous file with comments | « src/debug.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698