Loading tests/robotests/src/com/android/settings/DeviceInfoSettingsTest.java +5 −2 Original line number Diff line number Diff line Loading @@ -45,7 +45,11 @@ import org.robolectric.annotation.Config; import java.util.List; @RunWith(SettingsRobolectricTestRunner.class) @Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION) @Config( manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = ShadowUtils.class ) public class DeviceInfoSettingsTest { @Mock(answer = Answers.RETURNS_DEEP_STUBS) Loading Loading @@ -83,7 +87,6 @@ public class DeviceInfoSettingsTest { } @Test @Config(shadows = ShadowUtils.class) public void testNonIndexableKeys_existInXmlLayout() { final Context context = RuntimeEnvironment.application; final List<String> niks = DeviceInfoSettings.SEARCH_INDEX_DATA_PROVIDER Loading tests/robotests/src/com/android/settings/MasterClearTest.java +5 −4 Original line number Diff line number Diff line Loading @@ -33,7 +33,6 @@ import android.os.Bundle; import android.provider.Settings; import android.view.LayoutInflater; import android.view.View; import android.widget.CheckBox; import android.widget.LinearLayout; import android.widget.ScrollView; Loading @@ -46,12 +45,15 @@ import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.robolectric.Robolectric; import org.robolectric.RuntimeEnvironment; import org.robolectric.annotation.Config; import org.robolectric.shadows.ShadowActivity; @RunWith(SettingsRobolectricTestRunner.class) @Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION) @Config( manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = {ShadowUtils.class} ) public class MasterClearTest { @Mock Loading Loading @@ -144,7 +146,6 @@ public class MasterClearTest { } @Test @Config(shadows = { ShadowUtils.class }) public void testInitiateMasterClear_inDemoMode_sendsIntent() { ShadowUtils.setIsDemoUser(true); Loading tests/robotests/src/com/android/settings/SecuritySettingsTest.java +5 −4 Original line number Diff line number Diff line Loading @@ -60,7 +60,11 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; @RunWith(SettingsRobolectricTestRunner.class) @Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION) @Config( manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = {ShadowLockPatternUtils.class} ) public class SecuritySettingsTest { private static final String MOCK_SUMMARY = "summary"; Loading Loading @@ -181,9 +185,6 @@ public class SecuritySettingsTest { } @Test @Config (shadows = { ShadowLockPatternUtils.class, }) public void testNonIndexableKeys_existInXmlLayout() { final Context context = spy(RuntimeEnvironment.application); UserManager manager = mock(UserManager.class); Loading tests/robotests/src/com/android/settings/accounts/AccountHeaderPreferenceControllerTest.java +5 −2 Original line number Diff line number Diff line Loading @@ -50,7 +50,11 @@ import org.robolectric.annotation.Implements; @RunWith(SettingsRobolectricTestRunner.class) @Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION) @Config( manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = AccountHeaderPreferenceControllerTest.ShadowAuthenticatorHelper.class ) public class AccountHeaderPreferenceControllerTest { @Mock(answer = Answers.RETURNS_DEEP_STUBS) Loading Loading @@ -83,7 +87,6 @@ public class AccountHeaderPreferenceControllerTest { } @Test @Config(shadows = ShadowAuthenticatorHelper.class) public void onResume_shouldDisplayAccountInEntityHeader() { final Lifecycle lifecycle = new Lifecycle(); final Account account = new Account("name1@abc.com", "com.abc"); Loading tests/robotests/src/com/android/settings/accounts/AccountPreferenceControllerTest.java +0 −13 Original line number Diff line number Diff line Loading @@ -111,7 +111,6 @@ public class AccountPreferenceControllerTest { } @Test @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class}) public void onResume_linkedUser_shouldAddOneAccountCategory() { final UserInfo info = new UserInfo(1, "user 1", 0); when(mUserManager.isManagedProfile()).thenReturn(false); Loading @@ -124,7 +123,6 @@ public class AccountPreferenceControllerTest { } @Test @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class}) public void onResume_oneProfile_shouldAddOneAccountCategory() { final List<UserInfo> infos = new ArrayList<>(); infos.add(new UserInfo(1, "user 1", 0)); Loading @@ -138,7 +136,6 @@ public class AccountPreferenceControllerTest { } @Test @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class}) public void onResume_twoProfiles_shouldAddTwoAccountCategory() { final List<UserInfo> infos = new ArrayList<>(); infos.add(new UserInfo(1, "user 1", 0)); Loading @@ -153,7 +150,6 @@ public class AccountPreferenceControllerTest { } @Test @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class}) public void onResume_noProfileChange_shouldNotAddOrRemoveAccountCategory() { final List<UserInfo> infos = new ArrayList<>(); infos.add(new UserInfo(1, "user 1", 0)); Loading @@ -171,7 +167,6 @@ public class AccountPreferenceControllerTest { } @Test @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class}) public void onResume_oneNewProfile_shouldAddOneAccountCategory() { final List<UserInfo> infos = new ArrayList<>(); infos.add(new UserInfo(1, "user 1", 0)); Loading @@ -189,7 +184,6 @@ public class AccountPreferenceControllerTest { } @Test @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class}) public void onResume_oneProfileRemoved_shouldRemoveOneAccountCategory() { final List<UserInfo> infos = new ArrayList<>(); infos.add(new UserInfo(1, "user 1", 0)); Loading @@ -207,7 +201,6 @@ public class AccountPreferenceControllerTest { } @Test @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class}) public void onResume_oneProfile_shouldSetAccountTitleWithUserName() { final List<UserInfo> infos = new ArrayList<>(); infos.add(new UserInfo(1, "user 1", UserInfo.FLAG_MANAGED_PROFILE)); Loading @@ -226,7 +219,6 @@ public class AccountPreferenceControllerTest { } @Test @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class}) public void onResume_noPreferenceScreen_shouldNotCrash() { final List<UserInfo> infos = new ArrayList<>(); infos.add(new UserInfo(1, "user 1", 0)); Loading @@ -244,7 +236,6 @@ public class AccountPreferenceControllerTest { } @Test @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class}) public void onResume_noPreferenceManager_shouldNotCrash() { when(mFragment.getPreferenceManager()).thenReturn(null); final List<UserInfo> infos = new ArrayList<>(); Loading Loading @@ -337,7 +328,6 @@ public class AccountPreferenceControllerTest { } @Test @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class}) public void onResume_twoAccountsOfSameType_shouldAddThreePreferences() { final List<UserInfo> infos = new ArrayList<>(); infos.add(new UserInfo(1, "user 1", 0)); Loading Loading @@ -417,7 +407,6 @@ public class AccountPreferenceControllerTest { } @Test @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class}) public void onResume_noAccountChange_shouldNotAddAccountPreference() { final List<UserInfo> infos = new ArrayList<>(); infos.add(new UserInfo(1, "user 1", 0)); Loading Loading @@ -498,7 +487,6 @@ public class AccountPreferenceControllerTest { } @Test @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class}) public void onResume_oneNewAccountType_shouldAddOneAccountPreference() { final List<UserInfo> infos = new ArrayList<>(); infos.add(new UserInfo(1, "user 1", 0)); Loading Loading @@ -534,7 +522,6 @@ public class AccountPreferenceControllerTest { } @Test @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class}) public void onResume_oneAccountRemoved_shouldRemoveOneAccountPreference() { final List<UserInfo> infos = new ArrayList<>(); infos.add(new UserInfo(1, "user 1", 0)); Loading Loading
tests/robotests/src/com/android/settings/DeviceInfoSettingsTest.java +5 −2 Original line number Diff line number Diff line Loading @@ -45,7 +45,11 @@ import org.robolectric.annotation.Config; import java.util.List; @RunWith(SettingsRobolectricTestRunner.class) @Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION) @Config( manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = ShadowUtils.class ) public class DeviceInfoSettingsTest { @Mock(answer = Answers.RETURNS_DEEP_STUBS) Loading Loading @@ -83,7 +87,6 @@ public class DeviceInfoSettingsTest { } @Test @Config(shadows = ShadowUtils.class) public void testNonIndexableKeys_existInXmlLayout() { final Context context = RuntimeEnvironment.application; final List<String> niks = DeviceInfoSettings.SEARCH_INDEX_DATA_PROVIDER Loading
tests/robotests/src/com/android/settings/MasterClearTest.java +5 −4 Original line number Diff line number Diff line Loading @@ -33,7 +33,6 @@ import android.os.Bundle; import android.provider.Settings; import android.view.LayoutInflater; import android.view.View; import android.widget.CheckBox; import android.widget.LinearLayout; import android.widget.ScrollView; Loading @@ -46,12 +45,15 @@ import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.robolectric.Robolectric; import org.robolectric.RuntimeEnvironment; import org.robolectric.annotation.Config; import org.robolectric.shadows.ShadowActivity; @RunWith(SettingsRobolectricTestRunner.class) @Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION) @Config( manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = {ShadowUtils.class} ) public class MasterClearTest { @Mock Loading Loading @@ -144,7 +146,6 @@ public class MasterClearTest { } @Test @Config(shadows = { ShadowUtils.class }) public void testInitiateMasterClear_inDemoMode_sendsIntent() { ShadowUtils.setIsDemoUser(true); Loading
tests/robotests/src/com/android/settings/SecuritySettingsTest.java +5 −4 Original line number Diff line number Diff line Loading @@ -60,7 +60,11 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; @RunWith(SettingsRobolectricTestRunner.class) @Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION) @Config( manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = {ShadowLockPatternUtils.class} ) public class SecuritySettingsTest { private static final String MOCK_SUMMARY = "summary"; Loading Loading @@ -181,9 +185,6 @@ public class SecuritySettingsTest { } @Test @Config (shadows = { ShadowLockPatternUtils.class, }) public void testNonIndexableKeys_existInXmlLayout() { final Context context = spy(RuntimeEnvironment.application); UserManager manager = mock(UserManager.class); Loading
tests/robotests/src/com/android/settings/accounts/AccountHeaderPreferenceControllerTest.java +5 −2 Original line number Diff line number Diff line Loading @@ -50,7 +50,11 @@ import org.robolectric.annotation.Implements; @RunWith(SettingsRobolectricTestRunner.class) @Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION) @Config( manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = AccountHeaderPreferenceControllerTest.ShadowAuthenticatorHelper.class ) public class AccountHeaderPreferenceControllerTest { @Mock(answer = Answers.RETURNS_DEEP_STUBS) Loading Loading @@ -83,7 +87,6 @@ public class AccountHeaderPreferenceControllerTest { } @Test @Config(shadows = ShadowAuthenticatorHelper.class) public void onResume_shouldDisplayAccountInEntityHeader() { final Lifecycle lifecycle = new Lifecycle(); final Account account = new Account("name1@abc.com", "com.abc"); Loading
tests/robotests/src/com/android/settings/accounts/AccountPreferenceControllerTest.java +0 −13 Original line number Diff line number Diff line Loading @@ -111,7 +111,6 @@ public class AccountPreferenceControllerTest { } @Test @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class}) public void onResume_linkedUser_shouldAddOneAccountCategory() { final UserInfo info = new UserInfo(1, "user 1", 0); when(mUserManager.isManagedProfile()).thenReturn(false); Loading @@ -124,7 +123,6 @@ public class AccountPreferenceControllerTest { } @Test @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class}) public void onResume_oneProfile_shouldAddOneAccountCategory() { final List<UserInfo> infos = new ArrayList<>(); infos.add(new UserInfo(1, "user 1", 0)); Loading @@ -138,7 +136,6 @@ public class AccountPreferenceControllerTest { } @Test @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class}) public void onResume_twoProfiles_shouldAddTwoAccountCategory() { final List<UserInfo> infos = new ArrayList<>(); infos.add(new UserInfo(1, "user 1", 0)); Loading @@ -153,7 +150,6 @@ public class AccountPreferenceControllerTest { } @Test @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class}) public void onResume_noProfileChange_shouldNotAddOrRemoveAccountCategory() { final List<UserInfo> infos = new ArrayList<>(); infos.add(new UserInfo(1, "user 1", 0)); Loading @@ -171,7 +167,6 @@ public class AccountPreferenceControllerTest { } @Test @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class}) public void onResume_oneNewProfile_shouldAddOneAccountCategory() { final List<UserInfo> infos = new ArrayList<>(); infos.add(new UserInfo(1, "user 1", 0)); Loading @@ -189,7 +184,6 @@ public class AccountPreferenceControllerTest { } @Test @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class}) public void onResume_oneProfileRemoved_shouldRemoveOneAccountCategory() { final List<UserInfo> infos = new ArrayList<>(); infos.add(new UserInfo(1, "user 1", 0)); Loading @@ -207,7 +201,6 @@ public class AccountPreferenceControllerTest { } @Test @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class}) public void onResume_oneProfile_shouldSetAccountTitleWithUserName() { final List<UserInfo> infos = new ArrayList<>(); infos.add(new UserInfo(1, "user 1", UserInfo.FLAG_MANAGED_PROFILE)); Loading @@ -226,7 +219,6 @@ public class AccountPreferenceControllerTest { } @Test @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class}) public void onResume_noPreferenceScreen_shouldNotCrash() { final List<UserInfo> infos = new ArrayList<>(); infos.add(new UserInfo(1, "user 1", 0)); Loading @@ -244,7 +236,6 @@ public class AccountPreferenceControllerTest { } @Test @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class}) public void onResume_noPreferenceManager_shouldNotCrash() { when(mFragment.getPreferenceManager()).thenReturn(null); final List<UserInfo> infos = new ArrayList<>(); Loading Loading @@ -337,7 +328,6 @@ public class AccountPreferenceControllerTest { } @Test @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class}) public void onResume_twoAccountsOfSameType_shouldAddThreePreferences() { final List<UserInfo> infos = new ArrayList<>(); infos.add(new UserInfo(1, "user 1", 0)); Loading Loading @@ -417,7 +407,6 @@ public class AccountPreferenceControllerTest { } @Test @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class}) public void onResume_noAccountChange_shouldNotAddAccountPreference() { final List<UserInfo> infos = new ArrayList<>(); infos.add(new UserInfo(1, "user 1", 0)); Loading Loading @@ -498,7 +487,6 @@ public class AccountPreferenceControllerTest { } @Test @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class}) public void onResume_oneNewAccountType_shouldAddOneAccountPreference() { final List<UserInfo> infos = new ArrayList<>(); infos.add(new UserInfo(1, "user 1", 0)); Loading Loading @@ -534,7 +522,6 @@ public class AccountPreferenceControllerTest { } @Test @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class}) public void onResume_oneAccountRemoved_shouldRemoveOneAccountPreference() { final List<UserInfo> infos = new ArrayList<>(); infos.add(new UserInfo(1, "user 1", 0)); Loading