From 2b0d9a5778923b8cb05e64cd911b1d230968434c Mon Sep 17 00:00:00 2001 From: Jonathan Scott Date: Thu, 6 Jun 2019 17:12:01 +0100 Subject: [PATCH] Use Activity Context in RemoveAccountPreferenceControllerTest. Test: make -j56 RunSettingsRoboTests Bug: 117487838 Change-Id: I2647bf98018e72af24053a336c8246d1f7e5fd4b --- .../accounts/RemoveAccountPreferenceControllerTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/robotests/src/com/android/settings/accounts/RemoveAccountPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/accounts/RemoveAccountPreferenceControllerTest.java index d98d30aff6b..5e18c7c06a6 100644 --- a/tests/robotests/src/com/android/settings/accounts/RemoveAccountPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/accounts/RemoveAccountPreferenceControllerTest.java @@ -64,6 +64,7 @@ import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.MockitoAnnotations; +import org.robolectric.Robolectric; import org.robolectric.RobolectricTestRunner; import org.robolectric.RuntimeEnvironment; import org.robolectric.annotation.Config; @@ -113,8 +114,8 @@ public class RemoveAccountPreferenceControllerTest { when(mAccountManager.getAuthenticatorTypesAsUser(anyInt())) .thenReturn(new AuthenticatorDescription[0]); when(mAccountManager.getAccountsAsUser(anyInt())).thenReturn(new Account[0]); - mController = new RemoveAccountPreferenceController(RuntimeEnvironment.application, - mFragment); + mController = new RemoveAccountPreferenceController( + Robolectric.setupActivity(Activity.class), mFragment); } @After