| Index: test/cctest/test-api.cc
|
| diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
|
| index 3a92f765c6c032e7d9a2ccbc8ea3dc87861a5dcf..9048dfb6114a85b075d85b9198b8ed7aad82faae 100644
|
| --- a/test/cctest/test-api.cc
|
| +++ b/test/cctest/test-api.cc
|
| @@ -20741,6 +20741,14 @@ static void MicrotaskTwo(const v8::FunctionCallbackInfo<Value>& info) {
|
| }
|
|
|
|
|
| +void* g_passed_to_three = NULL;
|
| +
|
| +
|
| +static void MicrotaskThree(void* data) {
|
| + g_passed_to_three = data;
|
| +}
|
| +
|
| +
|
| TEST(EnqueueMicrotask) {
|
| LocalContext env;
|
| v8::HandleScope scope(env->GetIsolate());
|
| @@ -20774,6 +20782,25 @@ TEST(EnqueueMicrotask) {
|
| CompileRun("1+1;");
|
| CHECK_EQ(2, CompileRun("ext1Calls")->Int32Value());
|
| CHECK_EQ(2, CompileRun("ext2Calls")->Int32Value());
|
| +
|
| + g_passed_to_three = NULL;
|
| + env->GetIsolate()->EnqueueMicrotask(MicrotaskThree);
|
| + CompileRun("1+1;");
|
| + CHECK_EQ(NULL, g_passed_to_three);
|
| + CHECK_EQ(2, CompileRun("ext1Calls")->Int32Value());
|
| + CHECK_EQ(2, CompileRun("ext2Calls")->Int32Value());
|
| +
|
| + int dummy;
|
| + env->GetIsolate()->EnqueueMicrotask(
|
| + Function::New(env->GetIsolate(), MicrotaskOne));
|
| + env->GetIsolate()->EnqueueMicrotask(MicrotaskThree, &dummy);
|
| + env->GetIsolate()->EnqueueMicrotask(
|
| + Function::New(env->GetIsolate(), MicrotaskTwo));
|
| + CompileRun("1+1;");
|
| + CHECK_EQ(&dummy, g_passed_to_three);
|
| + CHECK_EQ(3, CompileRun("ext1Calls")->Int32Value());
|
| + CHECK_EQ(3, CompileRun("ext2Calls")->Int32Value());
|
| + g_passed_to_three = NULL;
|
| }
|
|
|
|
|
|
|