Index: components/variations/android/junit/src/org/chromium/components/variations/firstrun/VariationsSeedFetcherTest.java |
diff --git a/components/variations/android/junit/src/org/chromium/components/variations/firstrun/VariationsSeedFetcherTest.java b/components/variations/android/junit/src/org/chromium/components/variations/firstrun/VariationsSeedFetcherTest.java |
index 9c725103ddb9e6a058187904d2b46a9aa073cac0..1835e1ea53347109705da60f0c910198870c1baf 100644 |
--- a/components/variations/android/junit/src/org/chromium/components/variations/firstrun/VariationsSeedFetcherTest.java |
+++ b/components/variations/android/junit/src/org/chromium/components/variations/firstrun/VariationsSeedFetcherTest.java |
@@ -24,6 +24,7 @@ import org.junit.After; |
import org.junit.Before; |
import org.junit.Test; |
import org.junit.runner.RunWith; |
+import org.robolectric.RuntimeEnvironment; |
import org.robolectric.annotation.Config; |
import org.chromium.base.ContextUtils; |
@@ -46,6 +47,7 @@ public class VariationsSeedFetcherTest { |
@Before |
public void setUp() throws IOException { |
+ ContextUtils.initApplicationContextForTests(RuntimeEnvironment.application); |
mikecase (-- gone --)
2017/03/07 20:29:41
Adding this fixed some errors when running the tes
jwd
2017/03/08 22:44:33
What does this line do? The robolectric doc on Run
mikecase (-- gone --)
2017/03/09 01:50:28
I think RuntimeEnvironment.application is just how
jwd
2017/03/09 15:16:31
Ok, seems fine to add it. The test shouldn't be af
|
// Pretend we are not on the UI thread, since the class we are testing is supposed to run |
// only on a background thread. |
ThreadUtils.setUiThread(mock(Looper.class)); |