From 4d45b1633d33858a3acc588ae674f24f27af018e Mon Sep 17 00:00:00 2001 From: Christoph Purrer Date: Fri, 23 Oct 2026 17:25:24 -0700 Subject: [PATCH 1/5] Bridgeless-context FabricUIManagerPullModelTest (#59271) Summary: Migrate `FabricUIManagerPullModelTest` from the deprecated `createCatalystContextForTest` helper to `createTestReactApplicationContext`, so the test builds a bridgeless context directly. Changelog: [Internal] Differential Revision: D126574347 --- .../com/facebook/react/fabric/FabricUIManagerPullModelTest.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/FabricUIManagerPullModelTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/FabricUIManagerPullModelTest.kt index e0796289dfc3..ee4ae40079e6 100644 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/FabricUIManagerPullModelTest.kt +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/FabricUIManagerPullModelTest.kt @@ -39,6 +39,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.mockito.kotlin.mock import org.robolectric.RobolectricTestRunner +import org.robolectric.RuntimeEnvironment import org.robolectric.Shadows.shadowOf import org.robolectric.annotation.Config import org.robolectric.shadow.api.Shadow @@ -76,7 +77,8 @@ class FabricUIManagerPullModelTest { fun setup() { ReactNativeFeatureFlagsForTests.setUp() overrideFeatureFlags() - reactContext = ReactTestHelper.createCatalystContextForTest() + reactContext = + ReactTestHelper.createTestReactApplicationContext(RuntimeEnvironment.getApplication()) underTest = FabricUIManager( reactContext, From b69710c4ff6ae7acee55a040299b66a4d81e29cb Mon Sep 17 00:00:00 2001 From: Christoph Purrer Date: Fri, 23 Oct 2026 17:25:24 -0700 Subject: [PATCH 2/5] Bridgeless-context MountingManagerAnimatedPropsTest (#59272) Summary: Migrate `MountingManagerAnimatedPropsTest` from the deprecated `createCatalystContextForTest` helper to `createTestReactApplicationContext`, so the test builds a bridgeless context directly. Changelog: [Internal] Differential Revision: D126574351 --- .../facebook/react/fabric/MountingManagerAnimatedPropsTest.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/MountingManagerAnimatedPropsTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/MountingManagerAnimatedPropsTest.kt index f9f4f59e5795..4a3f6f936d3c 100644 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/MountingManagerAnimatedPropsTest.kt +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/MountingManagerAnimatedPropsTest.kt @@ -31,6 +31,7 @@ import org.junit.Before import org.junit.Test import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner +import org.robolectric.RuntimeEnvironment import org.robolectric.annotation.Config @RunWith(RobolectricTestRunner::class) @@ -54,7 +55,8 @@ class MountingManagerAnimatedPropsTest { @Before fun setUp() { ReactNativeFeatureFlagsForTests.setUp() - val reactContext = ReactTestHelper.createCatalystContextForTest() + val reactContext = + ReactTestHelper.createTestReactApplicationContext(RuntimeEnvironment.getApplication()) themedReactContext = ThemedReactContext(reactContext, reactContext, null, -1) mountingManager = MountingManager(ViewManagerRegistry(listOf>(ReactViewManager())), {}) From be61b7c44348fc4b8376ee948df34e55da5ca702 Mon Sep 17 00:00:00 2001 From: Christoph Purrer Date: Fri, 23 Oct 2026 17:25:24 -0700 Subject: [PATCH 3/5] Bridgeless-context SurfaceMountingManagerSynchronousMountPropsTest (#59273) Summary: Migrate `SurfaceMountingManagerSynchronousMountPropsTest` from the deprecated `createCatalystContextForTest` helper to `createTestReactApplicationContext`, so the test builds a bridgeless context directly. Changelog: [Internal] Differential Revision: D126574353 --- .../fabric/SurfaceMountingManagerSynchronousMountPropsTest.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/SurfaceMountingManagerSynchronousMountPropsTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/SurfaceMountingManagerSynchronousMountPropsTest.kt index 884078cdc72c..1e7e51deb722 100644 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/SurfaceMountingManagerSynchronousMountPropsTest.kt +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/SurfaceMountingManagerSynchronousMountPropsTest.kt @@ -34,6 +34,7 @@ import org.junit.Before import org.junit.Test import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner +import org.robolectric.RuntimeEnvironment import org.robolectric.annotation.Config /** @@ -65,7 +66,8 @@ class SurfaceMountingManagerSynchronousMountPropsTest { @Before fun setUp() { ReactNativeFeatureFlagsForTests.setUp() - val reactContext = ReactTestHelper.createCatalystContextForTest() + val reactContext = + ReactTestHelper.createTestReactApplicationContext(RuntimeEnvironment.getApplication()) themedReactContext = ThemedReactContext(reactContext, reactContext, null, -1) mountingManager = MountingManager( From 38b1106fc90f18217b4545d97c8d5a3dc76ef4e6 Mon Sep 17 00:00:00 2001 From: Christoph Purrer Date: Fri, 23 Oct 2026 17:25:24 -0700 Subject: [PATCH 4/5] Bridgeless-context SurfaceMountingManagerTest (#59274) Summary: Migrate `SurfaceMountingManagerTest` from the deprecated `createCatalystContextForTest` helper to `createTestReactApplicationContext`, so the test builds a bridgeless context directly. Add the `ShadowSoLoader` Robolectric shadow, which the new helper needs to mock the component factory. Changelog: [Internal] Differential Revision: D126574354 --- .../facebook/react/fabric/SurfaceMountingManagerTest.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/SurfaceMountingManagerTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/SurfaceMountingManagerTest.kt index f7372288b68f..a1282668eb23 100644 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/SurfaceMountingManagerTest.kt +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/SurfaceMountingManagerTest.kt @@ -20,11 +20,14 @@ import com.facebook.react.uimanager.ThemedReactContext import com.facebook.react.uimanager.ViewManager import com.facebook.react.uimanager.ViewManagerRegistry import com.facebook.react.views.view.ReactViewManager +import com.facebook.testutils.shadows.ShadowSoLoader import org.assertj.core.api.Assertions.assertThat import org.junit.Before import org.junit.Test import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner +import org.robolectric.RuntimeEnvironment +import org.robolectric.annotation.Config /** * Tests for [SurfaceMountingManager] view lifecycle around preallocateView, deleteView, and @@ -42,6 +45,7 @@ import org.robolectric.RobolectricTestRunner * See T223288217. */ @RunWith(RobolectricTestRunner::class) +@Config(shadows = [ShadowSoLoader::class]) class SurfaceMountingManagerTest { private lateinit var mountingManager: MountingManager private lateinit var themedReactContext: ThemedReactContext @@ -50,7 +54,8 @@ class SurfaceMountingManagerTest { @Before fun setUp() { ReactNativeFeatureFlagsForTests.setUp() - val reactContext = ReactTestHelper.createCatalystContextForTest() + val reactContext = + ReactTestHelper.createTestReactApplicationContext(RuntimeEnvironment.getApplication()) themedReactContext = ThemedReactContext(reactContext, reactContext, null, -1) mountingManager = MountingManager( From 3f85182067dda6b569328e37e098f89f0f742260 Mon Sep 17 00:00:00 2001 From: Christoph Purrer Date: Fri, 23 Oct 2026 17:25:24 -0700 Subject: [PATCH 5/5] Bridgeless-context BaseViewManagerDelegateTest (#59275) Summary: Migrate `BaseViewManagerDelegateTest` from the deprecated `createCatalystContextForTest` helper to `createTestReactApplicationContext`, so the test builds a bridgeless context directly. Add the `ShadowSoLoader` Robolectric shadow, which the new helper needs to mock the component factory. Changelog: [Internal] Differential Revision: D126574355 --- .../react/uimanager/BaseViewManagerDelegateTest.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/uimanager/BaseViewManagerDelegateTest.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/uimanager/BaseViewManagerDelegateTest.java index 13ad5c6a95c3..329f88e2fee8 100644 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/uimanager/BaseViewManagerDelegateTest.java +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/uimanager/BaseViewManagerDelegateTest.java @@ -16,13 +16,17 @@ import com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsForTests; import com.facebook.react.views.view.ReactViewGroup; import com.facebook.react.views.view.ReactViewManager; +import com.facebook.testutils.shadows.ShadowSoLoader; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; +import org.robolectric.RuntimeEnvironment; +import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) +@Config(shadows = ShadowSoLoader.class) public class BaseViewManagerDelegateTest { private ReactViewManager viewManager; private ReactViewGroup view; @@ -34,7 +38,9 @@ public void setUp() { // (non-JNI) accessor so Robolectric doesn't try to load react_featureflagsjni. ReactNativeFeatureFlagsForTests.INSTANCE.setUp(); viewManager = mock(ReactViewManager.class); - ReactApplicationContext context = ReactTestHelper.createCatalystContextForTest(); + ReactApplicationContext context = + ReactTestHelper.INSTANCE.createTestReactApplicationContext( + RuntimeEnvironment.getApplication()); ThemedReactContext themedReactContext = new ThemedReactContext(context, context, null, -1); view = new ReactViewGroup(themedReactContext); delegate = new BaseViewManagerDelegate<>(viewManager) {};