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

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

Issue 141041: Do not fail on matching breakpoint against snippet with incompatible line range. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 6 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-delay.js ('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 2226)
+++ test/cctest/test-debug.cc (working copy)
@@ -5257,3 +5257,40 @@
CHECK_EQ(1, exception_event_count);
}
+
+
+// Tests after compile event is sent when there are some provisional
+// breakpoints out of the scripts lines range.
+TEST(ProvisionalBreakpointOnLineOutOfRange) {
+ v8::HandleScope scope;
+ DebugLocalContext env;
+ env.ExposeDebug();
+ const char* script = "function f() {};";
+ const char* resource_name = "test_resource";
+
+ // Set a couple of provisional breakpoint on lines out of the script lines
+ // range.
+ int sbp1 = SetScriptBreakPointByNameFromJS(resource_name, 3,
+ -1 /* no column */);
+ int sbp2 = SetScriptBreakPointByNameFromJS(resource_name, 5, 5);
+
+ after_compile_message_count = 0;
+ v8::Debug::SetMessageHandler2(AfterCompileMessageHandler);
+
+ v8::ScriptOrigin origin(
+ v8::String::New(resource_name),
+ v8::Integer::New(10),
+ v8::Integer::New(1));
+ // Compile a script whose first line number is greater than the breakpoints'
+ // lines.
+ v8::Script::Compile(v8::String::New(script), &origin)->Run();
+
+ // If the script is compiled successfully there is exactly one after compile
+ // event. In case of an exception in debugger code after compile event is not
+ // sent.
+ CHECK_EQ(1, after_compile_message_count);
+
+ ClearBreakPointFromJS(sbp1);
+ ClearBreakPointFromJS(sbp2);
+ v8::Debug::SetMessageHandler2(NULL);
+}
« no previous file with comments | « src/debug-delay.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698