mirror of
https://github.com/status-im/react-native.git
synced 2025-01-27 09:45:04 +00:00
Fix race in catalyst tests
Summary: Native code accesses the Java Application through the ApplicationHolder. The application should be set on the holder as soon as possible. This change fixes a race in WebWorkersTest. public Reviewed By: astreet Differential Revision: D2905157 fb-gh-sync-id: 7e488f4eecefedb8482276776b3a66e14a843f90
This commit is contained in:
parent
7cbad9f530
commit
294185ac32
@ -147,7 +147,6 @@ public abstract class ReactIntegrationTestCase extends AndroidTestCase {
|
||||
mBridgeIdleSignaler = new ReactBridgeIdleSignaler();
|
||||
mInstance.addBridgeIdleDebugListener(mBridgeIdleSignaler);
|
||||
getContext().initializeWithInstance(mInstance);
|
||||
ApplicationHolder.setApplication((Application) getContext().getApplicationContext());
|
||||
}
|
||||
|
||||
public boolean waitForBridgeIdle(long millis) {
|
||||
@ -165,6 +164,12 @@ public abstract class ReactIntegrationTestCase extends AndroidTestCase {
|
||||
IDLE_TIMEOUT_MS);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
ApplicationHolder.setApplication((Application) getContext().getApplicationContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
super.tearDown();
|
||||
|
Loading…
x
Reference in New Issue
Block a user