Index: test/cctest/test-debug.cc |
diff --git a/test/cctest/test-debug.cc b/test/cctest/test-debug.cc |
index f50cac5989e0a83b4907925fa0eabf84c4f2f28a..5af65cb1082e52a1e21c630d39d764084d2b22eb 100644 |
--- a/test/cctest/test-debug.cc |
+++ b/test/cctest/test-debug.cc |
@@ -5662,6 +5662,27 @@ |
CheckDebuggerUnloaded(isolate); |
} |
+ |
+TEST(DebugContextIsPreservedBetweenAccesses) { |
+ v8::HandleScope scope(CcTest::isolate()); |
+ v8::Debug::SetDebugEventListener(CcTest::isolate(), |
+ DebugEventBreakPointHitCount); |
+ v8::Local<v8::Context> context1 = |
+ v8::Debug::GetDebugContext(CcTest::isolate()); |
+ v8::Local<v8::Context> context2 = |
+ v8::Debug::GetDebugContext(CcTest::isolate()); |
+ CHECK(v8::Utils::OpenHandle(*context1).is_identical_to( |
+ v8::Utils::OpenHandle(*context2))); |
+ v8::Debug::SetDebugEventListener(CcTest::isolate(), nullptr); |
+} |
+ |
+ |
+TEST(NoDebugContextWhenDebuggerDisabled) { |
+ v8::HandleScope scope(CcTest::isolate()); |
+ v8::Local<v8::Context> context = |
+ v8::Debug::GetDebugContext(CcTest::isolate()); |
+ CHECK(context.IsEmpty()); |
+} |
static v8::Local<v8::Value> expected_callback_data; |
static void DebugEventContextChecker(const v8::Debug::EventDetails& details) { |