Unconditionally enable ANGLE developer option UI.
Bug: b/283781993 Test: atest CtsAngleIntegrationHostTestCases -c Test: atest SettingsRoboTests:GraphicsDriverEnableAngleAsSystemDriverControllerTest Change-Id: I7f491151cc26dc10ccdb2900cfa81ff09c23b184
This commit is contained in:
@@ -20,7 +20,6 @@ import static com.android.settings.development.graphicsdriver.GraphicsDriverEnab
|
||||
import static com.android.settings.development.graphicsdriver.GraphicsDriverEnableAngleAsSystemDriverController.Injector;
|
||||
import static com.android.settings.development.graphicsdriver.GraphicsDriverEnableAngleAsSystemDriverController.PROPERTY_DEBUG_ANGLE_DEVELOPER_OPTION;
|
||||
import static com.android.settings.development.graphicsdriver.GraphicsDriverEnableAngleAsSystemDriverController.PROPERTY_PERSISTENT_GRAPHICS_EGL;
|
||||
import static com.android.settings.development.graphicsdriver.GraphicsDriverEnableAngleAsSystemDriverController.PROPERTY_RO_GFX_ANGLE_SUPPORTED;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
@@ -181,31 +180,13 @@ public class GraphicsDriverEnableAngleAsSystemDriverControllerJUnitTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void updateState_angleNotSupported_PreferenceShouldDisabled() {
|
||||
when(mSystemPropertiesMock.get(eq(PROPERTY_RO_GFX_ANGLE_SUPPORTED), any())).thenReturn("");
|
||||
mController.updateState(mPreference);
|
||||
assertThat(mPreference.isEnabled()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void updateState_angleNotSupported_PreferenceShouldNotBeChecked() {
|
||||
when(mSystemPropertiesMock.get(eq(PROPERTY_RO_GFX_ANGLE_SUPPORTED), any())).thenReturn("");
|
||||
mController.updateState(mPreference);
|
||||
assertThat(mPreference.isChecked()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void updateState_angleSupported_PreferenceShouldEnabled() {
|
||||
when(mSystemPropertiesMock.get(eq(PROPERTY_RO_GFX_ANGLE_SUPPORTED), any()))
|
||||
.thenReturn("true");
|
||||
public void updateState_PreferenceShouldEnabled() {
|
||||
mController.updateState(mPreference);
|
||||
assertThat(mPreference.isEnabled()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void updateState_angleSupported_angleIsSystemGLESDriver_PreferenceShouldBeChecked() {
|
||||
when(mSystemPropertiesMock.get(eq(PROPERTY_RO_GFX_ANGLE_SUPPORTED), any()))
|
||||
.thenReturn("true");
|
||||
public void updateState_angleIsSystemGLESDriver_PreferenceShouldBeChecked() {
|
||||
when(mSystemPropertiesMock.get(eq(PROPERTY_PERSISTENT_GRAPHICS_EGL), any()))
|
||||
.thenReturn(ANGLE_DRIVER_SUFFIX);
|
||||
mController.updateState(mPreference);
|
||||
@@ -213,10 +194,7 @@ public class GraphicsDriverEnableAngleAsSystemDriverControllerJUnitTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void
|
||||
updateState_angleSupported_angleIsNotSystemGLESDriver_PreferenceShouldNotBeChecked() {
|
||||
when(mSystemPropertiesMock.get(eq(PROPERTY_RO_GFX_ANGLE_SUPPORTED), any()))
|
||||
.thenReturn("true");
|
||||
public void updateState_angleIsNotSystemGLESDriver_PreferenceShouldNotBeChecked() {
|
||||
when(mSystemPropertiesMock.get(eq(PROPERTY_PERSISTENT_GRAPHICS_EGL), any())).thenReturn("");
|
||||
mController.updateState(mPreference);
|
||||
assertThat(mPreference.isChecked()).isFalse();
|
||||
@@ -232,8 +210,6 @@ public class GraphicsDriverEnableAngleAsSystemDriverControllerJUnitTest {
|
||||
|
||||
// Test that onDeveloperOptionSwitchDisabled,
|
||||
// persist.graphics.egl updates to ""
|
||||
when(mSystemPropertiesMock.get(eq(PROPERTY_RO_GFX_ANGLE_SUPPORTED), any()))
|
||||
.thenReturn("true");
|
||||
mController.onDeveloperOptionsSwitchDisabled();
|
||||
propertyChangeSignal1.wait(100);
|
||||
final String systemEGLDriver = SystemProperties.get(PROPERTY_PERSISTENT_GRAPHICS_EGL);
|
||||
@@ -245,16 +221,12 @@ public class GraphicsDriverEnableAngleAsSystemDriverControllerJUnitTest {
|
||||
|
||||
@Test
|
||||
public void onDeveloperOptionSwitchDisabled_PreferenceShouldNotBeChecked() {
|
||||
when(mSystemPropertiesMock.get(eq(PROPERTY_RO_GFX_ANGLE_SUPPORTED), any()))
|
||||
.thenReturn("true");
|
||||
mController.onDeveloperOptionsSwitchDisabled();
|
||||
assertThat(mPreference.isChecked()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onDeveloperOptionSwitchDisabled_PreferenceShouldDisabled() {
|
||||
when(mSystemPropertiesMock.get(eq(PROPERTY_RO_GFX_ANGLE_SUPPORTED), any()))
|
||||
.thenReturn("true");
|
||||
mController.onDeveloperOptionsSwitchDisabled();
|
||||
assertThat(mPreference.isEnabled()).isFalse();
|
||||
}
|
||||
@@ -480,8 +452,6 @@ public class GraphicsDriverEnableAngleAsSystemDriverControllerJUnitTest {
|
||||
// Test that when debug.graphics.angle.developeroption.enable is false:
|
||||
when(mSystemPropertiesMock.getBoolean(eq(PROPERTY_DEBUG_ANGLE_DEVELOPER_OPTION),
|
||||
anyBoolean())).thenReturn(false);
|
||||
when(mSystemPropertiesMock.get(eq(PROPERTY_RO_GFX_ANGLE_SUPPORTED), any()))
|
||||
.thenReturn("true");
|
||||
|
||||
// 1. "Enable ANGLE" switch is on, the switch should be enabled.
|
||||
when(mSystemPropertiesMock.get(eq(PROPERTY_PERSISTENT_GRAPHICS_EGL), any()))
|
||||
|
Reference in New Issue
Block a user