Java Code Examples for com.facebook.soloader.SoLoader#setInTestMode()

The following examples show how to use com.facebook.soloader.SoLoader#setInTestMode() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ReactImagePropertyTest.java    From react-native-GPay with MIT License 5 votes vote down vote up
@Before
public void setup() {
  SoLoader.setInTestMode();
  mContext = new ReactApplicationContext(RuntimeEnvironment.application);
  mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();
  mContext.initializeWithInstance(mCatalystInstanceMock);
  mThemeContext = new ThemedReactContext(mContext, mContext);
  Fresco.initialize(mContext);
  DisplayMetricsHolder.setWindowDisplayMetrics(new DisplayMetrics());
}
 
Example 2
Source File: TestNativeLoader.java    From fresco with MIT License 5 votes vote down vote up
/**
 * Initialize NativeLoader by setting NativeLoaderToSoLoaderDelegate as delegate and calling
 * setInTestMode for SoLoader
 */
public static void init() {
  if (!NativeLoader.isInitialized()) {
    NativeLoader.init(new NativeLoaderToSoLoaderDelegate());
  }
  SoLoader.setInTestMode();
}