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

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

Issue 2848032: Clear function breakpoints in Debug::HandleWeakDebugInfo callback. (Closed)
Patch Set: Created 10 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
« src/debug.cc ('K') | « 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
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;
« src/debug.cc ('K') | « src/debug.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698