Index: test/cctest/test-debug.cc |
diff --git a/test/cctest/test-debug.cc b/test/cctest/test-debug.cc |
index 353fa671d394c48dc82029d5b0d987543d2146b7..3187f152f90d4d9c8627b84f85951ca9ffee971c 100644 |
--- a/test/cctest/test-debug.cc |
+++ b/test/cctest/test-debug.cc |
@@ -4327,6 +4327,22 @@ TEST(DisableBreak) { |
CheckDebuggerUnloaded(env->GetIsolate()); |
} |
+TEST(DisableDebuggerStatement) { |
+ DebugLocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
+ |
+ // Register a debug event listener which sets the break flag and counts. |
+ v8::Debug::SetDebugEventListener(env->GetIsolate(), DebugEventCounter); |
+ CompileRun("debugger;"); |
+ CHECK_EQ(1, break_point_hit_count); |
+ |
+ // Check that we ignore debugger statement when breakpoints aren't active. |
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(env->GetIsolate()); |
+ isolate->debug()->set_break_points_active(false); |
+ CompileRun("debugger;"); |
+ CHECK_EQ(1, break_point_hit_count); |
+} |
+ |
static const char* kSimpleExtensionSource = |
"(function Foo() {" |
" return 4;" |