MCPcopy Create free account
hub / github.com/Snapchat/Valdi / TestModuleFactory

Class TestModuleFactory

valdi/test/integration/Runtime_tests.cpp:8778–8790  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8776
8777 auto attribution = tree->getContext()->getAttribution();
8778
8779 ASSERT_EQ(&myAttributionFn, attribution.fn);
8780 ASSERT_EQ(STRING_LITERAL("test"), attribution.moduleName);
8781 ASSERT_EQ(STRING_LITERAL("someOwner"), attribution.owner);
8782
8783 auto callCountBefore = myAttributionFnCallCount.load();
8784 wrapper.runtime->getJavaScriptRuntime()->dispatchOnJsThreadSync(tree->getContext(), [](const auto& /*jsEntry*/) {});
8785
8786 // When scheduling on JS thread, it could use our attribution function
8787 ASSERT_GT(myAttributionFnCallCount.load(), callCountBefore);
8788}
8789
8790TEST_P(RuntimeFixture, supportsValdiStyleModuleLoading) {
8791 wrapper.teardown();
8792
8793 auto tweakModule = makeShared<TestTweakValueProvider>().toShared();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected