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

Unified Diff: test/cctest/compiler/test-run-bytecode-graph-builder.cc

Issue 2727393003: [debugger,api] deprecate everything in v8-debug.h (Closed)
Patch Set: remove TODO Created 3 years, 9 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 | « test/cctest/cctest.h ('k') | test/cctest/test-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-run-bytecode-graph-builder.cc
diff --git a/test/cctest/compiler/test-run-bytecode-graph-builder.cc b/test/cctest/compiler/test-run-bytecode-graph-builder.cc
index b21447ef30c8713802335dc63e757ed9836b9eac..37838225632f1b9c2cfe75c66e5a824bf7e0248b 100644
--- a/test/cctest/compiler/test-run-bytecode-graph-builder.cc
+++ b/test/cctest/compiler/test-run-bytecode-graph-builder.cc
@@ -6,6 +6,7 @@
#include "src/compilation-info.h"
#include "src/compiler/pipeline.h"
+#include "src/debug/debug-interface.h"
#include "src/execution.h"
#include "src/handles.h"
#include "src/interpreter/bytecode-array-builder.h"
@@ -2966,16 +2967,22 @@ TEST(BytecodeGraphBuilderIllegalConstDeclaration) {
}
}
-static int debug_break_count = 0;
-static void DebugEventCounter(const v8::Debug::EventDetails& event_details) {
- if (event_details.GetEvent() == v8::Break) debug_break_count++;
-}
+class CountBreakDebugDelegate : public v8::debug::DebugDelegate {
+ public:
+ void BreakProgramRequested(v8::Local<v8::Context> paused_context,
+ v8::Local<v8::Object> exec_state,
+ v8::Local<v8::Value> break_points_hit) override {
+ debug_break_count++;
+ }
+ int debug_break_count = 0;
+};
TEST(BytecodeGraphBuilderDebuggerStatement) {
+ CountBreakDebugDelegate delegate;
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
- v8::Debug::SetDebugEventListener(CcTest::isolate(), DebugEventCounter);
+ v8::debug::SetDebugDelegate(CcTest::isolate(), &delegate);
ExpectedSnippet<0> snippet = {
"function f() {"
@@ -2988,9 +2995,9 @@ TEST(BytecodeGraphBuilderDebuggerStatement) {
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
- v8::Debug::SetDebugEventListener(CcTest::isolate(), nullptr);
+ v8::debug::SetDebugDelegate(CcTest::isolate(), nullptr);
CHECK(return_value.is_identical_to(snippet.return_value()));
- CHECK_EQ(2, debug_break_count);
+ CHECK_EQ(2, delegate.debug_break_count);
}
} // namespace compiler
« no previous file with comments | « test/cctest/cctest.h ('k') | test/cctest/test-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698