mirror of
https://github.com/status-im/react-native.git
synced 2025-01-27 09:45:04 +00:00
Add switch for enabling nodes screenshot tests
Summary: Allow customizing the UIImplementation passed in to loadApp. Differential Revision: D2975785 fb-gh-sync-id: 2ce081fb488b78c0c91fcebe6a37dac4f587a467 shipit-source-id: 2ce081fb488b78c0c91fcebe6a37dac4f587a467
This commit is contained in:
parent
6bcb2a05eb
commit
6b80f11652
@ -28,7 +28,7 @@ import com.facebook.react.ReactInstanceManager;
|
||||
import com.facebook.react.ReactPackage;
|
||||
import com.facebook.react.ReactRootView;
|
||||
import com.facebook.react.shell.MainReactPackage;
|
||||
|
||||
import com.facebook.react.uimanager.UIImplementationProvider;
|
||||
|
||||
public class ReactAppTestActivity extends FragmentActivity implements
|
||||
DefaultHardwareBackBtnHandler
|
||||
@ -112,6 +112,14 @@ public class ReactAppTestActivity extends FragmentActivity implements
|
||||
loadApp(appKey, spec, null, bundleName, false /* = useDevSupport */);
|
||||
}
|
||||
|
||||
public void loadApp(
|
||||
String appKey,
|
||||
ReactInstanceSpecForTest spec,
|
||||
String bundleName,
|
||||
UIImplementationProvider uiImplementationProvider) {
|
||||
loadApp(appKey, spec, null, bundleName, false /* = useDevSupport */, uiImplementationProvider);
|
||||
}
|
||||
|
||||
public void resetRootViewForScreenshotTests() {
|
||||
if (mReactInstanceManager != null) {
|
||||
mReactInstanceManager.destroy();
|
||||
@ -128,6 +136,16 @@ public class ReactAppTestActivity extends FragmentActivity implements
|
||||
@Nullable Bundle initialProps,
|
||||
String bundleName,
|
||||
boolean useDevSupport) {
|
||||
loadApp(appKey, spec, initialProps, bundleName, useDevSupport, null);
|
||||
}
|
||||
|
||||
public void loadApp(
|
||||
String appKey,
|
||||
ReactInstanceSpecForTest spec,
|
||||
@Nullable Bundle initialProps,
|
||||
String bundleName,
|
||||
boolean useDevSupport,
|
||||
UIImplementationProvider uiImplementationProvider) {
|
||||
|
||||
final CountDownLatch currentLayoutEvent = mLayoutEvent = new CountDownLatch(1);
|
||||
mBridgeIdleSignaler = new ReactBridgeIdleSignaler();
|
||||
@ -145,7 +163,8 @@ public class ReactAppTestActivity extends FragmentActivity implements
|
||||
.addPackage(new InstanceSpecForTestPackage(spec))
|
||||
.setUseDeveloperSupport(useDevSupport)
|
||||
.setBridgeIdleDebugListener(mBridgeIdleSignaler)
|
||||
.setInitialLifecycleState(mLifecycleState);
|
||||
.setInitialLifecycleState(mLifecycleState)
|
||||
.setUIImplementationProvider(uiImplementationProvider);
|
||||
|
||||
mReactInstanceManager = builder.build();
|
||||
mReactInstanceManager.onHostResume(this, this);
|
||||
|
Loading…
x
Reference in New Issue
Block a user