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

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

Issue 10702166: Do not enter the debugger when debugger is not active. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 5 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/execution.cc ('k') | test/cctest/test-heap.cc » ('j') | 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 9f52cea2b3d490a846ecdacb86a68e7cd131fd6f..39d918d25e610a3ebc9df587907ca375638a8a35 100644
--- a/test/cctest/test-debug.cc
+++ b/test/cctest/test-debug.cc
@@ -7392,4 +7392,32 @@ TEST(Regress131642) {
v8::Debug::SetDebugEventListener(NULL);
}
+
+// Import from test-heap.cc
+int CountGlobalContexts();
+
+
+static void NopListener(v8::DebugEvent event,
+ v8::Handle<v8::Object> exec_state,
+ v8::Handle<v8::Object> event_data,
+ v8::Handle<v8::Value> data) {
+}
+
+
+TEST(DebuggerCreatesContextIffActive) {
+ v8::HandleScope scope;
+ DebugLocalContext env;
+ CHECK_EQ(1, CountGlobalContexts());
+
+ v8::Debug::SetDebugEventListener(NULL);
+ CompileRun("debugger;");
+ CHECK_EQ(1, CountGlobalContexts());
+
+ v8::Debug::SetDebugEventListener(NopListener);
+ CompileRun("debugger;");
+ CHECK_EQ(2, CountGlobalContexts());
+
+ v8::Debug::SetDebugEventListener(NULL);
+}
+
#endif // ENABLE_DEBUGGER_SUPPORT
« no previous file with comments | « src/execution.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698