mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-04 22:56:32 +08:00
use a static react instance holder
Reviewed By: astreet Differential Revision: D2937867 fb-gh-sync-id: cdda79929fa5993b6ef159aa73922909017c2ded shipit-source-id: cdda79929fa5993b6ef159aa73922909017c2ded
This commit is contained in:
committed by
facebook-github-bot-7
parent
b516976457
commit
19a1c4c229
@@ -75,7 +75,7 @@ public class ReactAppTestActivity extends FragmentActivity implements
|
||||
overridePendingTransition(0, 0);
|
||||
|
||||
if (mReactInstanceManager != null) {
|
||||
mReactInstanceManager.onPause();
|
||||
mReactInstanceManager.onHostPause();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ public class ReactAppTestActivity extends FragmentActivity implements
|
||||
mLifecycleState = LifecycleState.RESUMED;
|
||||
|
||||
if (mReactInstanceManager != null) {
|
||||
mReactInstanceManager.onResume(this, this);
|
||||
mReactInstanceManager.onHostResume(this, this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ public class ReactAppTestActivity extends FragmentActivity implements
|
||||
mDestroyCountDownLatch.countDown();
|
||||
|
||||
if (mReactInstanceManager != null) {
|
||||
mReactInstanceManager.onDestroy();
|
||||
mReactInstanceManager.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ public class ReactAppTestActivity extends FragmentActivity implements
|
||||
|
||||
public void resetRootViewForScreenshotTests() {
|
||||
if (mReactInstanceManager != null) {
|
||||
mReactInstanceManager.onDestroy();
|
||||
mReactInstanceManager.destroy();
|
||||
mReactInstanceManager = null;
|
||||
}
|
||||
mReactRootView = new ReactRootView(this);
|
||||
@@ -148,7 +148,7 @@ public class ReactAppTestActivity extends FragmentActivity implements
|
||||
.setInitialLifecycleState(mLifecycleState);
|
||||
|
||||
mReactInstanceManager = builder.build();
|
||||
mReactInstanceManager.onResume(this, this);
|
||||
mReactInstanceManager.onHostResume(this, this);
|
||||
|
||||
Assertions.assertNotNull(mReactRootView).getViewTreeObserver().addOnGlobalLayoutListener(
|
||||
new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
|
||||
@@ -74,7 +74,7 @@ public abstract class ReactIntegrationTestCase extends AndroidTestCase {
|
||||
@Override
|
||||
public void run() {
|
||||
if (contextToDestroy != null) {
|
||||
contextToDestroy.onDestroy();
|
||||
contextToDestroy.destroy();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user