Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index 93c8e41f053795e02fb9a4cd698c525ec3db1ac2..cbead0fc05757971ddb5c9c5fb86316cc09661d5 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -20821,6 +20821,25 @@ TEST(SetAutorunMicrotasks) { |
} |
+TEST(RunMicrotasksWithoutEnteringContext) { |
+ v8::Isolate* isolate = CcTest::isolate(); |
+ HandleScope handle_scope(isolate); |
+ isolate->SetAutorunMicrotasks(false); |
+ Handle<Context> context = Context::New(isolate); |
+ { |
+ Context::Scope context_scope(context); |
+ CompileRun("var ext1Calls = 0;"); |
+ isolate->EnqueueMicrotask(Function::New(isolate, MicrotaskOne)); |
+ } |
+ isolate->RunMicrotasks(); |
+ { |
+ Context::Scope context_scope(context); |
+ CHECK_EQ(1, CompileRun("ext1Calls")->Int32Value()); |
+ } |
+ isolate->SetAutorunMicrotasks(true); |
+} |
+ |
+ |
static int probes_counter = 0; |
static int misses_counter = 0; |
static int updates_counter = 0; |