Use new JSI method to queue microtasks in RuntimeSchedulerTest

Summary:
Changelog: [internal]

Now that `jsi::Runtime::queueMicrotask` is available, we can use it instead of calling an internal Hermes API in `RuntimeSchedulerTest`.

Reviewed By: christophpurrer

Differential Revision: D54416245

fbshipit-source-id: c9cbd3783d9dc1c3df499a7fec7acb6c229ec571
This commit is contained in:
Rubén Norte
2024-03-04 05:03:39 -08:00
committed by Facebook GitHub Bot
parent bd89afa284
commit dc254acace
@@ -200,13 +200,7 @@ TEST_P(
return jsi::Value::undefined();
});
// Hermes doesn't expose a C++ API to schedule microtasks, so we just access
// the API that it exposes to JS.
auto global = runtime_->global();
auto enqueueJobFn = global.getPropertyAsObject(*runtime_, "HermesInternal")
.getPropertyAsFunction(*runtime_, "enqueueJob");
enqueueJobFn.call(*runtime_, std::move(microtaskCallback));
runtime_->queueMicrotask(microtaskCallback);
return jsi::Value::undefined();
});