Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1197)

Unified Diff: base/android/junit/src/org/chromium/base/BaseChromiumApplicationTest.java

Issue 2243353002: (Reland) Update all Robolectric tests to Robolectric 3.0 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/BUILD.gn ('k') | base/android/junit/src/org/chromium/base/PromiseTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/junit/src/org/chromium/base/BaseChromiumApplicationTest.java
diff --git a/base/android/junit/src/org/chromium/base/BaseChromiumApplicationTest.java b/base/android/junit/src/org/chromium/base/BaseChromiumApplicationTest.java
index bfcd7aa2eebb4ebeb5c390106403e470dfb5eb46..88810483c320518266d32525a52c46cacc73ed8b 100644
--- a/base/android/junit/src/org/chromium/base/BaseChromiumApplicationTest.java
+++ b/base/android/junit/src/org/chromium/base/BaseChromiumApplicationTest.java
@@ -13,15 +13,17 @@ import android.view.KeyEvent;
import junit.framework.Assert;
import org.chromium.base.BaseChromiumApplication.WindowFocusChangedListener;
-import org.chromium.base.test.shadows.ShadowMultiDex;
import org.chromium.testing.local.LocalRobolectricTestRunner;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
+import org.robolectric.RuntimeEnvironment;
+import org.robolectric.Shadows;
import org.robolectric.annotation.Config;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
import org.robolectric.shadows.ShadowActivity;
+import org.robolectric.shadows.multidex.ShadowMultiDex;
import org.robolectric.util.ActivityController;
/** Unit tests for {@link BaseChromiumApplication}. */
@@ -52,7 +54,7 @@ public class BaseChromiumApplicationTest {
@Test
public void testWindowsFocusChanged() throws Exception {
- BaseChromiumApplication app = (BaseChromiumApplication) Robolectric.application;
+ BaseChromiumApplication app = (BaseChromiumApplication) RuntimeEnvironment.application;
WindowFocusChangedListener mock = mock(WindowFocusChangedListener.class);
app.registerWindowFocusChangedListener(mock);
@@ -60,7 +62,7 @@ public class BaseChromiumApplicationTest {
ActivityController<Activity> controller =
Robolectric.buildActivity(Activity.class).create().start().visible();
TrackingShadowActivity shadow =
- (TrackingShadowActivity) Robolectric.shadowOf(controller.get());
+ (TrackingShadowActivity) Shadows.shadowOf(controller.get());
controller.get().getWindow().getCallback().onWindowFocusChanged(true);
// Assert that listeners were notified.
« no previous file with comments | « base/BUILD.gn ('k') | base/android/junit/src/org/chromium/base/PromiseTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698