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

Unified Diff: test/cctest/test-code-stub-assembler.cc

Issue 2575313002: [promisehook] Implement PromiseHook (Closed)
Patch Set: add tests 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
« src/isolate.cc ('K') | « test/cctest/test-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-code-stub-assembler.cc
diff --git a/test/cctest/test-code-stub-assembler.cc b/test/cctest/test-code-stub-assembler.cc
index ea44b2f5f5abac53c97384370dd9880b0387f92b..355008ef1d7242a3a69dedcb1cd4cb9be4bb91c9 100644
--- a/test/cctest/test-code-stub-assembler.cc
+++ b/test/cctest/test-code-stub-assembler.cc
@@ -1972,6 +1972,9 @@ TEST(CodeStubAssemblerGraphsCorrectness) {
v8_isolate->Dispose();
}
+void CustomPromiseHook(v8::PromiseHookType type, v8::Local<v8::Promise> promise,
+ v8::Local<v8::Value> parentPromise) {}
+
TEST(IsPromiseHookEnabled) {
Isolate* isolate(CcTest::InitIsolateOnce());
@@ -1990,11 +1993,11 @@ TEST(IsPromiseHookEnabled) {
ft.Call(isolate->factory()->undefined_value()).ToHandleChecked();
CHECK_EQ(isolate->heap()->false_value(), *result);
- isolate->EnablePromiseHook();
+ isolate->SetPromiseHook(CustomPromiseHook);
result = ft.Call(isolate->factory()->undefined_value()).ToHandleChecked();
CHECK_EQ(isolate->heap()->true_value(), *result);
- isolate->DisablePromiseHook();
+ isolate->SetPromiseHook(nullptr);
result = ft.Call(isolate->factory()->undefined_value()).ToHandleChecked();
CHECK_EQ(isolate->heap()->false_value(), *result);
}
« src/isolate.cc ('K') | « test/cctest/test-api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698