Search in sources :

Example 6 with BrightnessConfiguration

use of android.hardware.display.BrightnessConfiguration in project robolectric by robolectric.

the class ShadowDisplayManagerTest method getBrightnessConfiguration_setToNull_shouldReturnDefault.

@Test
@Config(minSdk = P)
public void getBrightnessConfiguration_setToNull_shouldReturnDefault() {
    BrightnessConfiguration config = new BrightnessConfiguration.Builder(/* lux= */
    new float[] { 0.0f, 5000.0f }, /* nits= */
    new float[] { 2.0f, 400.0f }).build();
    ShadowDisplayManager.setDefaultBrightnessConfiguration(config);
    instance.setBrightnessConfiguration(null);
    assertThat(instance.getBrightnessConfiguration()).isEqualTo(config);
}
Also used : BrightnessConfiguration(android.hardware.display.BrightnessConfiguration) Test(org.junit.Test) Config(org.robolectric.annotation.Config)

Aggregations

BrightnessConfiguration (android.hardware.display.BrightnessConfiguration)6 Test (org.junit.Test)4 Config (org.robolectric.annotation.Config)4 HiddenApi (org.robolectric.annotation.HiddenApi)1 Implementation (org.robolectric.annotation.Implementation)1