Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index 927f74c135ba0afe1504c20877dd66ae2d3fdaf9..cec1e653fcb7300bcc97008957aeeb84dedfab55 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -18262,11 +18262,24 @@ TEST(PromiseHook) { |
global->Get(context, v8_str("resolve")).ToLocalChecked(); |
auto before_promise = global->Get(context, v8_str("before")).ToLocalChecked(); |
auto after_promise = global->Get(context, v8_str("after")).ToLocalChecked(); |
- CHECK(GetPromise("p")->Equals(env.local(), before_promise).FromJust()); |
- CHECK(GetPromise("p")->Equals(env.local(), after_promise).FromJust()); |
+ CHECK(GetPromise("p1")->Equals(env.local(), before_promise).FromJust()); |
+ CHECK(GetPromise("p1")->Equals(env.local(), after_promise).FromJust()); |
CHECK(GetPromise("p1")->Equals(env.local(), resolve_promise).FromJust()); |
CHECK_EQ(6, promise_hook_data->promise_hook_count); |
+ CompileRun("value = ''; var p2 = p1.then(() => { value = 'fulfilled' }); \n"); |
+ init_promise = global->Get(context, v8_str("init")).ToLocalChecked(); |
+ parent_promise = global->Get(context, v8_str("parent")).ToLocalChecked(); |
+ resolve_promise = global->Get(context, v8_str("resolve")).ToLocalChecked(); |
+ before_promise = global->Get(context, v8_str("before")).ToLocalChecked(); |
+ after_promise = global->Get(context, v8_str("after")).ToLocalChecked(); |
+ CHECK(GetPromise("p2")->Equals(env.local(), init_promise).FromJust()); |
+ CHECK(GetPromise("p1")->Equals(env.local(), parent_promise).FromJust()); |
+ CHECK(GetPromise("p2")->Equals(env.local(), before_promise).FromJust()); |
+ CHECK(GetPromise("p2")->Equals(env.local(), after_promise).FromJust()); |
+ CHECK(GetPromise("p2")->Equals(env.local(), resolve_promise).FromJust()); |
+ CHECK_EQ(10, promise_hook_data->promise_hook_count); |
+ |
promise_hook_data->Reset(); |
promise_hook_data->promise_hook_value = "rejected"; |
source = |
@@ -18291,8 +18304,8 @@ TEST(PromiseHook) { |
resolve_promise = global->Get(context, v8_str("resolve")).ToLocalChecked(); |
before_promise = global->Get(context, v8_str("before")).ToLocalChecked(); |
after_promise = global->Get(context, v8_str("after")).ToLocalChecked(); |
- CHECK(GetPromise("p")->Equals(env.local(), before_promise).FromJust()); |
- CHECK(GetPromise("p")->Equals(env.local(), after_promise).FromJust()); |
+ CHECK(GetPromise("p1")->Equals(env.local(), before_promise).FromJust()); |
+ CHECK(GetPromise("p1")->Equals(env.local(), after_promise).FromJust()); |
CHECK(GetPromise("p1")->Equals(env.local(), resolve_promise).FromJust()); |
CHECK_EQ(6, promise_hook_data->promise_hook_count); |
@@ -18320,8 +18333,8 @@ TEST(PromiseHook) { |
CHECK(GetPromise("p1")->Equals(env.local(), init_promise).FromJust()); |
CHECK(GetPromise("p1")->Equals(env.local(), resolve_promise).FromJust()); |
CHECK(GetPromise("p")->Equals(env.local(), parent_promise).FromJust()); |
- CHECK(GetPromise("p")->Equals(env.local(), before_promise).FromJust()); |
- CHECK(GetPromise("p")->Equals(env.local(), after_promise).FromJust()); |
+ CHECK(GetPromise("p1")->Equals(env.local(), before_promise).FromJust()); |
+ CHECK(GetPromise("p1")->Equals(env.local(), after_promise).FromJust()); |
CHECK_EQ(6, promise_hook_data->promise_hook_count); |
CHECK_EQ(1, promise_hook_data->parent_promise_count); |
@@ -18460,8 +18473,8 @@ TEST(PromiseHook) { |
resolve_promise = global->Get(context, v8_str("resolve")).ToLocalChecked(); |
before_promise = global->Get(context, v8_str("before")).ToLocalChecked(); |
after_promise = global->Get(context, v8_str("after")).ToLocalChecked(); |
- CHECK(GetPromise("p")->Equals(env.local(), before_promise).FromJust()); |
- CHECK(GetPromise("p")->Equals(env.local(), after_promise).FromJust()); |
+ CHECK(GetPromise("p1")->Equals(env.local(), before_promise).FromJust()); |
+ CHECK(GetPromise("p1")->Equals(env.local(), after_promise).FromJust()); |
CHECK(GetPromise("p1")->Equals(env.local(), resolve_promise).FromJust()); |
// 3) resolve hook (p) |
// 4) before hook (p) |