Migration of RN-Android OSS tests to Android X

Summary:
This diff migrates RN to AndroidX.
As part of this diff I disabled few tests in RNAndroid OSS that will be re-enabled this week. As part of the refactor of BUCK files in OSS

Reviewed By: shergin

Differential Revision: D14200097

fbshipit-source-id: 932fcae251d1553e672acd67ecd0e703dcb364aa
This commit is contained in:
David Vacca
2019-03-17 08:03:31 -07:00
committed by Facebook Github Bot
parent 5613aa8948
commit 8d5ac8de76
122 changed files with 1450 additions and 448 deletions
@@ -15,7 +15,6 @@ import javax.annotation.Nullable;
import android.app.Instrumentation;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.view.View;
import android.view.ViewGroup;
@@ -120,12 +119,13 @@ public class ReactTestHelper {
}
public static ReactTestFactory getReactTestFactory() {
Instrumentation inst = InstrumentationRegistry.getInstrumentation();
if (!(inst instanceof ReactTestFactory)) {
// TODO: re-enable after cleanup of android-x migration
// Instrumentation inst = InstrumentationRegistry.getInstrumentation();
// if (!(inst instanceof ReactTestFactory)) {
return new DefaultReactTestFactory();
}
return (ReactTestFactory) inst;
// }
//
// return (ReactTestFactory) inst;
}
public static ReactTestFactory.ReactInstanceEasyBuilder catalystInstanceBuilder(
@@ -151,13 +151,14 @@ public class ReactTestHelper {
final CatalystInstance instance = builder.build();
testCase.initializeWithInstance(instance);
instance.runJSBundle();
InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() {
@Override
public void run() {
// TODO: re-enable after cleanup of android-x migration
// InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() {
// @Override
// public void run() {
ReactChoreographer.initialize();
instance.initialize();
}
});
// }
// });
testCase.waitForBridgeAndUIIdle();
return instance;
}