Make Settings robotest work with tot Robolectric

Bug: 116278591
Test: make -j RunSettingsRoboTests
Change-Id: I32cb2fcf6094675f79d2fc24702ef6298a9691e4
This commit is contained in:
Fan Zhang
2018-10-11 15:37:36 -07:00
parent dd3feeb155
commit cdf284b732
140 changed files with 706 additions and 823 deletions

View File

@@ -72,7 +72,7 @@ public class ZenModeRemindersPreferenceControllerTest {
ShadowApplication shadowApplication = ShadowApplication.getInstance();
shadowApplication.setSystemService(Context.NOTIFICATION_SERVICE, mNotificationManager);
mContext = shadowApplication.getApplicationContext();
mContext = RuntimeEnvironment.application;
mContentResolver = RuntimeEnvironment.application.getContentResolver();
when(mNotificationManager.getNotificationPolicy()).thenReturn(mPolicy);
@@ -80,7 +80,7 @@ public class ZenModeRemindersPreferenceControllerTest {
ReflectionHelpers.setField(mController, "mBackend", mBackend);
when(mPreferenceScreen.findPreference(mController.getPreferenceKey()))
.thenReturn(mockPref);
.thenReturn(mockPref);
mController.displayPreference(mPreferenceScreen);
}
@@ -127,7 +127,7 @@ public class ZenModeRemindersPreferenceControllerTest {
mController.onPreferenceChange(mockPref, allow);
verify(mBackend)
.saveSoundPolicy(NotificationManager.Policy.PRIORITY_CATEGORY_REMINDERS, allow);
.saveSoundPolicy(NotificationManager.Policy.PRIORITY_CATEGORY_REMINDERS, allow);
}
@Test
@@ -136,6 +136,6 @@ public class ZenModeRemindersPreferenceControllerTest {
mController.onPreferenceChange(mockPref, allow);
verify(mBackend)
.saveSoundPolicy(NotificationManager.Policy.PRIORITY_CATEGORY_REMINDERS, allow);
.saveSoundPolicy(NotificationManager.Policy.PRIORITY_CATEGORY_REMINDERS, allow);
}
}