Merge "Game Driver: Fix EnableForAllApps switch and test"

This commit is contained in:
TreeHugger Robot
2019-02-01 19:14:03 +00:00
committed by Android (Google) Code Review
3 changed files with 29 additions and 13 deletions

View File

@@ -36,7 +36,6 @@ import androidx.preference.PreferenceScreen;
import androidx.preference.SwitchPreference;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@@ -63,11 +62,14 @@ public class GameDriverEnableForAllAppsPreferenceControllerTest {
MockitoAnnotations.initMocks(this);
mContext = RuntimeEnvironment.application;
mResolver = mContext.getContentResolver();
Settings.Global.putInt(mResolver, Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 1);
Settings.Global.putInt(
mResolver, Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_DEFAULT);
mController = new GameDriverEnableForAllAppsPreferenceController(mContext, "testKey");
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
mController.displayPreference(mScreen);
Settings.Global.putInt(mResolver, Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 1);
}
@Test
@@ -138,7 +140,6 @@ public class GameDriverEnableForAllAppsPreferenceControllerTest {
}
@Test
@Ignore("b/123707483")
public void updateState_gameDriverOff_notVisibleAndUncheck() {
Settings.Global.putInt(mResolver, Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_OFF);
mController.updateState(mPreference);