use of org.robolectric.shadows.ShadowContentResolver in project android_packages_apps_Settings by LineageOS.
the class BrightnessLevelPreferenceControllerTest method onStart_shouldRegisterObserver.
@Test
public void onStart_shouldRegisterObserver() {
Context context = RuntimeEnvironment.application;
BrightnessLevelPreferenceController controller = new BrightnessLevelPreferenceController(context, null, mPowerManager);
ShadowContentResolver shadowContentResolver = (ShadowContentResolver) ShadowExtractor.extract(context.getContentResolver());
controller.onStart();
assertThat(shadowContentResolver.getContentObservers(System.getUriFor(System.SCREEN_BRIGHTNESS_MODE))).isNotEmpty();
assertThat(shadowContentResolver.getContentObservers(System.getUriFor(System.SCREEN_BRIGHTNESS))).isNotEmpty();
assertThat(shadowContentResolver.getContentObservers(System.getUriFor(System.SCREEN_BRIGHTNESS_FOR_VR))).isNotEmpty();
assertThat(shadowContentResolver.getContentObservers(System.getUriFor(System.SCREEN_AUTO_BRIGHTNESS_ADJ))).isNotEmpty();
}
use of org.robolectric.shadows.ShadowContentResolver in project android_packages_apps_Settings by SudaMod.
the class BrightnessLevelPreferenceControllerTest method onStop_shouldUnregisterObserver.
@Test
public void onStop_shouldUnregisterObserver() {
Context context = RuntimeEnvironment.application;
BrightnessLevelPreferenceController controller = new BrightnessLevelPreferenceController(context, null, mPowerManager);
ShadowContentResolver shadowContentResolver = (ShadowContentResolver) ShadowExtractor.extract(context.getContentResolver());
controller.displayPreference(mScreen);
controller.onStart();
controller.onStop();
assertThat(shadowContentResolver.getContentObservers(System.getUriFor(System.SCREEN_BRIGHTNESS_MODE))).isEmpty();
assertThat(shadowContentResolver.getContentObservers(System.getUriFor(System.SCREEN_BRIGHTNESS))).isEmpty();
assertThat(shadowContentResolver.getContentObservers(System.getUriFor(System.SCREEN_BRIGHTNESS_FOR_VR))).isEmpty();
assertThat(shadowContentResolver.getContentObservers(System.getUriFor(System.SCREEN_AUTO_BRIGHTNESS_ADJ))).isEmpty();
}
use of org.robolectric.shadows.ShadowContentResolver in project android_packages_apps_Settings by DirtyUnicorns.
the class BrightnessLevelPreferenceControllerTest method onStart_shouldRegisterObserver.
@Test
public void onStart_shouldRegisterObserver() {
Context context = RuntimeEnvironment.application;
BrightnessLevelPreferenceController controller = new BrightnessLevelPreferenceController(context, null, mPowerManager);
ShadowContentResolver shadowContentResolver = (ShadowContentResolver) ShadowExtractor.extract(context.getContentResolver());
controller.onStart();
assertThat(shadowContentResolver.getContentObservers(System.getUriFor(System.SCREEN_BRIGHTNESS_MODE))).isNotEmpty();
assertThat(shadowContentResolver.getContentObservers(System.getUriFor(System.SCREEN_BRIGHTNESS))).isNotEmpty();
assertThat(shadowContentResolver.getContentObservers(System.getUriFor(System.SCREEN_BRIGHTNESS_FOR_VR))).isNotEmpty();
assertThat(shadowContentResolver.getContentObservers(System.getUriFor(System.SCREEN_AUTO_BRIGHTNESS_ADJ))).isNotEmpty();
}
use of org.robolectric.shadows.ShadowContentResolver in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class BrightnessLevelPreferenceControllerTest method onStop_shouldUnregisterObserver.
@Test
public void onStop_shouldUnregisterObserver() {
BrightnessLevelPreferenceController controller = new BrightnessLevelPreferenceController(mContext, null);
ShadowContentResolver shadowContentResolver = Shadow.extract(mContext.getContentResolver());
controller.displayPreference(mScreen);
controller.onStart();
controller.onStop();
assertThat(shadowContentResolver.getContentObservers(System.getUriFor(System.SCREEN_BRIGHTNESS))).isEmpty();
assertThat(shadowContentResolver.getContentObservers(System.getUriFor(System.SCREEN_BRIGHTNESS_FOR_VR))).isEmpty();
assertThat(shadowContentResolver.getContentObservers(System.getUriFor(System.SCREEN_AUTO_BRIGHTNESS_ADJ))).isEmpty();
}
use of org.robolectric.shadows.ShadowContentResolver in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class BrightnessLevelPreferenceControllerTest method onStart_shouldRegisterObserver.
@Test
public void onStart_shouldRegisterObserver() {
BrightnessLevelPreferenceController controller = new BrightnessLevelPreferenceController(mContext, null);
ShadowContentResolver shadowContentResolver = Shadow.extract(mContentResolver);
controller.onStart();
assertThat(shadowContentResolver.getContentObservers(System.getUriFor(System.SCREEN_BRIGHTNESS))).isNotEmpty();
assertThat(shadowContentResolver.getContentObservers(System.getUriFor(System.SCREEN_BRIGHTNESS_FOR_VR))).isNotEmpty();
assertThat(shadowContentResolver.getContentObservers(System.getUriFor(System.SCREEN_AUTO_BRIGHTNESS_ADJ))).isNotEmpty();
}
Aggregations