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

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

Issue 2589083002: [debugger] sunset --expose-debug-as flag. (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/flag-definitions.h ('k') | no next file » | 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 1461e31cd24fc78ed28c69811f559f1458c82925..c7eec30021f0f077746f047f4c4291726291f4f1 100644
--- a/test/cctest/compiler/test-run-bytecode-graph-builder.cc
+++ b/test/cctest/compiler/test-run-bytecode-graph-builder.cc
@@ -3027,35 +3027,32 @@ 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++;
+}
+
TEST(BytecodeGraphBuilderDebuggerStatement) {
- FLAG_expose_debug_as = "debug";
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
Zone* zone = scope.main_zone();
+ v8::Debug::SetDebugEventListener(CcTest::isolate(), DebugEventCounter);
+
ExpectedSnippet<0> snippet = {
- "var Debug = debug.Debug;"
- "var count = 0;"
"function f() {"
" debugger;"
"}"
- "function listener(event) {"
- " if (event == Debug.DebugEvent.Break) count++;"
- "}"
- "Debug.setListener(listener);"
- "f();"
- "Debug.setListener(null);"
- "return count;",
- {handle(Smi::FromInt(1), isolate)}};
-
- ScopedVector<char> script(1024);
- SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName,
- snippet.code_snippet, kFunctionName);
+ "f();",
+ {isolate->factory()->undefined_value()}};
- BytecodeGraphTester tester(isolate, zone, script.start());
+ BytecodeGraphTester tester(isolate, zone, snippet.code_snippet);
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
- CHECK(return_value->SameValue(*snippet.return_value()));
+
+ v8::Debug::SetDebugEventListener(CcTest::isolate(), nullptr);
+ CHECK(return_value.is_identical_to(snippet.return_value()));
+ CHECK_EQ(2, debug_break_count);
}
} // namespace compiler
« no previous file with comments | « src/flag-definitions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698