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

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

Issue 384120: Test that pause can be set in script and won't lead to crash when execution i... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 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 | « no previous file | 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 3300)
+++ test/cctest/test-debug.cc (working copy)
@@ -2728,6 +2728,37 @@
}
+// Tests that breakpoint will be hit if it's set in script.
+TEST(PauseInScript) {
+ v8::HandleScope scope;
+ DebugLocalContext env;
+ env.ExposeDebug();
+
+ // Register a debug event listener which counts.
+ v8::Debug::SetDebugEventListener(DebugEventCounter);
+
+ // Create a script that returns a function.
+ const char* src = "(function (evt) {})";
+ const char* script_name = "StepInHandlerTest";
+
+ // Set breakpoint in the script.
+ SetScriptBreakPointByNameFromJS(script_name, 0, -1);
+ break_point_hit_count = 0;
+
+ v8::ScriptOrigin origin(v8::String::New(script_name), v8::Integer::New(0));
+ v8::Handle<v8::Script> script = v8::Script::Compile(v8::String::New(src),
+ &origin);
+ v8::Local<v8::Value> r = script->Run();
+
+ CHECK(r->IsFunction());
+ CHECK_EQ(1, break_point_hit_count );
+
+ // Get rid of the debug event listener.
+ v8::Debug::SetDebugEventListener(NULL);
+ CheckDebuggerUnloaded();
+}
+
+
// Test break on exceptions. For each exception break combination the number
// of debug event exception callbacks and message callbacks are collected. The
// number of debug event exception callbacks are used to check that the
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698