mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add backward compatible support for onLayout event in Fabric
Reviewed By: achen1 Differential Revision: D8231722 fbshipit-source-id: 3d0641a7813e742ca81b98576f9ffc30ee597f30
This commit is contained in:
committed by
Facebook Github Bot
parent
6c989fe7c6
commit
6aea98441a
+4
-1
@@ -25,6 +25,8 @@ import com.facebook.react.testing.idledetection.IdleWaiter;
|
||||
public abstract class ReactInstrumentationTest extends
|
||||
ActivityInstrumentationTestCase2<ReactAppTestActivity> implements IdleWaiter {
|
||||
|
||||
protected StringRecordingModule mRecordingModule;
|
||||
|
||||
public ReactInstrumentationTest() {
|
||||
super(ReactAppTestActivity.class);
|
||||
}
|
||||
@@ -36,6 +38,7 @@ public abstract class ReactInstrumentationTest extends
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra(ReactAppTestActivity.EXTRA_IS_FABRIC_TEST, isFabricTest());
|
||||
setActivityIntent(intent);
|
||||
mRecordingModule = new StringRecordingModule();
|
||||
final ReactAppTestActivity activity = getActivity();
|
||||
activity.loadBundle(
|
||||
createReactInstanceSpecForTest(),
|
||||
@@ -95,7 +98,7 @@ public abstract class ReactInstrumentationTest extends
|
||||
* Override this method to provide extra native modules to be loaded before the app starts
|
||||
*/
|
||||
protected ReactInstanceSpecForTest createReactInstanceSpecForTest() {
|
||||
return new ReactInstanceSpecForTest();
|
||||
return new ReactInstanceSpecForTest().addNativeModule(mRecordingModule);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user