From a52d84d7e1cdb287f2877c4d85f2e9866c248d43 Mon Sep 17 00:00:00 2001 From: Andrew Jack Date: Thu, 7 Jun 2018 16:47:08 -0700 Subject: [PATCH] Fix ReactImagePropertyTest SoLoader failures (#19607) Summary: Fixes #18637 & #19309 Check Android `ReactImagePropertyTest` tests pass. [ANDROID] [BUGFIX] [Unit Tests] - Fix ReactImagePropertyTest SoLoader failure Closes https://github.com/facebook/react-native/pull/19607 Differential Revision: D8325415 Pulled By: hramos fbshipit-source-id: 598baa3499646bb50da065815c19bb9f76bf6c87 --- ReactAndroid/src/test/java/com/facebook/react/views/BUCK | 1 + .../com/facebook/react/views/image/ReactImagePropertyTest.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/ReactAndroid/src/test/java/com/facebook/react/views/BUCK b/ReactAndroid/src/test/java/com/facebook/react/views/BUCK index dc64ad96e..c50da6f54 100644 --- a/ReactAndroid/src/test/java/com/facebook/react/views/BUCK +++ b/ReactAndroid/src/test/java/com/facebook/react/views/BUCK @@ -13,6 +13,7 @@ rn_robolectric_test( react_native_dep("libraries/fresco/fresco-react-native:fresco-drawee"), react_native_dep("libraries/fresco/fresco-react-native:fresco-react-native"), react_native_dep("libraries/fresco/fresco-react-native:imagepipeline"), + react_native_dep("libraries/soloader/java/com/facebook/soloader:soloader"), react_native_dep("third-party/java/fest:fest"), react_native_dep("third-party/java/jsr-305:jsr-305"), react_native_dep("third-party/java/junit:junit"), diff --git a/ReactAndroid/src/test/java/com/facebook/react/views/image/ReactImagePropertyTest.java b/ReactAndroid/src/test/java/com/facebook/react/views/image/ReactImagePropertyTest.java index 93dc78450..2a1ee5755 100644 --- a/ReactAndroid/src/test/java/com/facebook/react/views/image/ReactImagePropertyTest.java +++ b/ReactAndroid/src/test/java/com/facebook/react/views/image/ReactImagePropertyTest.java @@ -20,6 +20,7 @@ import com.facebook.react.bridge.JavaOnlyMap; import com.facebook.react.uimanager.ReactStylesDiffMap; import com.facebook.react.uimanager.DisplayMetricsHolder; import com.facebook.react.uimanager.ThemedReactContext; +import com.facebook.soloader.SoLoader; import org.junit.After; import org.junit.Before; @@ -53,6 +54,7 @@ public class ReactImagePropertyTest { @Before public void setup() { + SoLoader.setInTestMode(); mContext = new ReactApplicationContext(RuntimeEnvironment.application); mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance(); mContext.initializeWithInstance(mCatalystInstanceMock);