Remove dead test-only method simulateAttachForTesting from ReactRootView

Summary:
X-link: https://github.com/facebook/react-native/pull/57136

`ReactRootView.simulateAttachForTesting()` was a package-private `VisibleForTesting` helper that set up the attach flags and dispatchers, but no test or production code ever called it. `RootViewTest` exercises `startReactApplication`/`unmountReactApplication` and the sibling `simulateCheckForKeyboardForTesting`, never this method. This removes the orphaned helper.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D108012908

fbshipit-source-id: ee550f66fae07bfeb75fd59b85d5d812fea7e2c1
This commit is contained in:
Samuel Susla authored and meta-codesync[bot] committed 2026-06-10 09:17:52 -07:00
1 parent cc23193e38
commit 925d3d4ba1
1 file changed
-16
@@ -776,22 +776,6 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot {
}
}
/**
* Is used by unit test to setup mIsAttachedToWindow flags, that will let this view to be properly
* attached to catalyst instance by startReactApplication call
*/
@VisibleForTesting
/* package */ void simulateAttachForTesting() {
mIsAttachedToInstance = true;
mJSTouchDispatcher = new JSTouchDispatcher(this);
if (ReactFeatureFlags.dispatchPointerEvents) {
mJSPointerDispatcher = new JSPointerDispatcher(this);
}
if (ReactNativeFeatureFlags.enableKeyEvents()) {
mJSKeyDispatcher = new JSKeyDispatcher();
}
}
@VisibleForTesting
/* package */ void simulateCheckForKeyboardForTesting() {
getCustomGlobalLayoutListener().checkForKeyboardEvents();