| 7827 | auto messageHandler = makeShared<MockRuntimeMessageHandler>(); |
| 7828 | wrapper.runtime->setRuntimeMessageHandler(messageHandler); |
| 7829 | wrapper.runtime->registerNativeModuleFactory(makeShared<NativeModuleReferenceTest>().toShared()); |
| 7830 | |
| 7831 | auto tree = wrapper.runtime->createViewNodeTreeAndContext( |
| 7832 | wrapper.standaloneRuntime->getViewManagerContext(), |
| 7833 | STRING_LITERAL("NativeModuleReference@test/src/NativeModuleReference")); |
| 7834 | |
| 7835 | wrapper.waitUntilAllUpdatesCompleted(); |
| 7836 | |
| 7837 | auto callCallback1 = getJsModulePropertyAsUntypedFunction( |
| 7838 | wrapper.runtime, nullptr, "test/src/NativeModuleReference", "callCallback1"); |
| 7839 | ASSERT_TRUE(callCallback1) << callCallback1.description(); |
| 7840 | |
| 7841 | auto callCallback2 = getJsModulePropertyAsUntypedFunction( |
| 7842 | wrapper.runtime, nullptr, "test/src/NativeModuleReference", "callCallback2"); |
| 7843 | ASSERT_TRUE(callCallback2) << callCallback2.description(); |
| 7844 | |
| 7845 | Value retValue; |
| 7846 | |
| 7847 | retValue = callCallback1.value()->call(ValueFunctionFlagsCallSync, {}).value(); |
| 7848 | |
| 7849 | ASSERT_EQ(Value(42.0), retValue); |
| 7850 | |
| 7851 | retValue = callCallback2.value()->call(ValueFunctionFlagsCallSync, {}).value(); |
| 7852 | ASSERT_EQ(Value(42.0), retValue); |
| 7853 | |
| 7854 | // We now destroy our context, which should make callback2 unusable |
nothing calls this directly
no test coverage detected