Fix Fabric SSTs, so they actually run in Fabric instead of Paper, convert ServerSnapshotTestsAppImpl to functional component

Summary:
Update instrumentation test infra for Fabric tests.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D19961919

fbshipit-source-id: 17264b6308712dddece730effd57832817e148cf
This commit is contained in:
Joshua Gross
2020-04-03 14:01:42 -07:00
committed by Facebook GitHub Bot
parent fb89730e66
commit 5c4425a456
@@ -75,6 +75,8 @@ public class ReactAppTestActivity extends FragmentActivity
rootView.addView(mScreenshotingFrameLayout);
mReactRootView = new ReactRootView(this);
// This is useful for standalone instrumentation tests, but not SSTs
Intent intent = getIntent();
if (intent != null && intent.getBooleanExtra(EXTRA_IS_FABRIC_TEST, false)) {
mReactRootView.setIsFabric(true);
@@ -165,6 +167,11 @@ public class ReactAppTestActivity extends FragmentActivity
}
public void renderComponent(final String appKey, final @Nullable Bundle initialProps) {
// This is used by SSTs
boolean fabricEnabled =
(initialProps != null ? initialProps.getBoolean(EXTRA_IS_FABRIC_TEST, false) : false);
mReactRootView.setIsFabric(fabricEnabled);
final CountDownLatch currentLayoutEvent = mLayoutEvent = new CountDownLatch(1);
runOnUiThread(
new Runnable() {