Index: test/cctest/test-debug.cc |
diff --git a/test/cctest/test-debug.cc b/test/cctest/test-debug.cc |
index e689637865369c8c9143555bcf753d5f43abe683..e3d4cf6262e922d30ef0819693bad3a8ac4e3e12 100644 |
--- a/test/cctest/test-debug.cc |
+++ b/test/cctest/test-debug.cc |
@@ -2075,6 +2075,39 @@ TEST(ScriptBreakPointLineTopLevel) { |
} |
+// Test that it is possible to add and remove break points in a top level |
+// function which is already a garbage but is not collected so far. |
Søren Thygesen Gjesse
2010/06/30 11:52:23
is already a garbage but is not collected so far->
|
+TEST(ScriptBreakPointTopLevelCrash) { |
+ v8::HandleScope scope; |
+ DebugLocalContext env; |
+ env.ExposeDebug(); |
+ |
+ v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount, |
+ v8::Undefined()); |
+ |
+ v8::Local<v8::String> script_source = v8::String::New( |
+ "function f() {\n" |
+ " return 0;\n" |
+ "}\n" |
+ "f()"); |
+ |
+ int sbp1 = SetScriptBreakPointByNameFromJS("test.html", 3, -1); |
+ { |
+ v8::HandleScope scope; |
+ break_point_hit_count = 0; |
+ v8::Script::Compile(script_source, v8::String::New("test.html"))->Run(); |
+ CHECK_EQ(1, break_point_hit_count); |
+ } |
+ |
+ int sbp2 = SetScriptBreakPointByNameFromJS("test.html", 3, -1); |
+ ClearBreakPointFromJS(sbp1); |
+ ClearBreakPointFromJS(sbp2); |
+ |
+ v8::Debug::SetDebugEventListener(NULL); |
+ CheckDebuggerUnloaded(); |
+} |
+ |
+ |
// Test that it is possible to remove the last break point for a function |
// inside the break handling of that break point. |
TEST(RemoveBreakPointInBreak) { |
@@ -2129,7 +2162,7 @@ TEST(DebuggerStatement) { |
} |
-// Test setting a breakpoint on the debugger statement. |
+// Test setting a breakpoint on the debugger statement. |
TEST(DebuggerStatementBreakpoint) { |
break_point_hit_count = 0; |
v8::HandleScope scope; |