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

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

Issue 2595413003: Revert of [debugger] deprecate v8::Debug:GetDebugContext. (Closed)
Patch Set: Created 4 years 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/api.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 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) {
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698