Loading tests/robotests/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragmentTest.java +0 −14 Original line number Diff line number Diff line Loading @@ -76,7 +76,6 @@ import com.android.settingslib.search.SearchIndexableRaw; import com.google.common.truth.Correspondence; import org.bouncycastle.util.Arrays; import org.junit.After; import org.junit.Before; import org.junit.Rule; Loading Loading @@ -1096,26 +1095,13 @@ public class ToggleScreenMagnificationPreferenceFragmentTest { enabled ? ON : OFF); } private static void addShadowInputDeviceId(int deviceId) { if (ShadowInputDevice.sDeviceIds == null) { ShadowInputDevice.sDeviceIds = new int[]{deviceId}; } else { int curLength = ShadowInputDevice.sDeviceIds.length; ShadowInputDevice.sDeviceIds = Arrays.copyOf(ShadowInputDevice.sDeviceIds, curLength + 1); ShadowInputDevice.sDeviceIds[curLength] = deviceId; } } private static void addMouseDevice() { addShadowInputDeviceId(SHADOW_MOUSE_DEVICE_ID); InputDevice device = ShadowInputDevice .makeInputDevicebyIdWithSources(SHADOW_MOUSE_DEVICE_ID, InputDevice.SOURCE_MOUSE); ShadowInputDevice.addDevice(SHADOW_MOUSE_DEVICE_ID, device); } private static void addKeyboardDevice() { addShadowInputDeviceId(SHADOW_KEYBOARD_DEVICE_ID); InputDevice device = ShadowInputDevice .makeFullKeyboardInputDevicebyId(SHADOW_KEYBOARD_DEVICE_ID); ShadowInputDevice.addDevice(SHADOW_KEYBOARD_DEVICE_ID, device); Loading tests/robotests/src/com/android/settings/inputmethod/ActionCornerPreferenceControllerTest.java +0 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,6 @@ public class ActionCornerPreferenceControllerTest { private void addTouchpad() { int deviceId = 1; ShadowInputDevice.sDeviceIds = new int[]{deviceId}; InputDevice device = ShadowInputDevice.makeInputDevicebyIdWithSources(deviceId, InputDevice.SOURCE_TOUCHPAD); ShadowInputDevice.addDevice(deviceId, device); Loading tests/robotests/src/com/android/settings/inputmethod/MouseSettingsControllerTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -67,7 +67,6 @@ public class MouseSettingsControllerTest { @DisableFlags(Flags.FLAG_KEYBOARD_AND_TOUCHPAD_A11Y_NEW_PAGE_ENABLED) public void getAvailabilityStatus_flagIsDisable_returnsUnavailable() { int deviceId = 1; ShadowInputDevice.sDeviceIds = new int[]{deviceId}; ShadowInputDevice.addDevice(deviceId, ShadowInputDevice.makeInputDevicebyId(deviceId)); assertThat(mController.getAvailabilityStatus()) .isEqualTo(BasePreferenceController.CONDITIONALLY_UNAVAILABLE); Loading @@ -77,7 +76,6 @@ public class MouseSettingsControllerTest { @EnableFlags(Flags.FLAG_KEYBOARD_AND_TOUCHPAD_A11Y_NEW_PAGE_ENABLED) public void getAvailabilityStatus_isMouse_returnsAvailable() { int deviceId = 1; ShadowInputDevice.sDeviceIds = new int[]{deviceId}; InputDevice device = ShadowInputDevice.makeInputDevicebyIdWithSources(deviceId, InputDevice.SOURCE_MOUSE); ShadowInputDevice.addDevice(deviceId, device); Loading tests/robotests/src/com/android/settings/inputmethod/PhysicalKeyboardA11yPreferenceControllerTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -67,7 +67,6 @@ public class PhysicalKeyboardA11yPreferenceControllerTest { @EnableFlags(Flags.FLAG_KEYBOARD_AND_TOUCHPAD_A11Y_NEW_PAGE_ENABLED) public void getAvailabilityStatus_expected() { int deviceId = 1; ShadowInputDevice.sDeviceIds = new int[]{deviceId}; when(mInputDevice.isVirtual()).thenReturn(false); when(mInputDevice.isFullKeyboard()).thenReturn(true); Loading @@ -83,7 +82,6 @@ public class PhysicalKeyboardA11yPreferenceControllerTest { @EnableFlags(Flags.FLAG_KEYBOARD_AND_TOUCHPAD_A11Y_NEW_PAGE_ENABLED) public void getAvailabilityStatus_deviceIsNotAsExpected_unavailable() { int deviceId = 1; ShadowInputDevice.sDeviceIds = new int[]{deviceId}; when(mInputDevice.isVirtual()).thenReturn(true); when(mInputDevice.isFullKeyboard()).thenReturn(false); Loading tests/robotests/src/com/android/settings/inputmethod/PhysicalKeyboardPreferenceControllerTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -107,7 +107,6 @@ public class PhysicalKeyboardPreferenceControllerTest { @Test @Config(shadows = ShadowInputDevice.class) public void updateState_noKeyboard_setPreferenceVisibleFalse() { ShadowInputDevice.sDeviceIds = new int[0]; mController.updateState(mPreference); verify(mPreference).setVisible(false); Loading @@ -120,7 +119,6 @@ public class PhysicalKeyboardPreferenceControllerTest { when(device.isVirtual()).thenReturn(false); when(device.isFullKeyboard()).thenReturn(true); when(device.getName()).thenReturn("test_keyboard"); ShadowInputDevice.sDeviceIds = new int[]{0}; ShadowInputDevice.addDevice(0, device); mController.updateState(mPreference); Loading Loading
tests/robotests/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragmentTest.java +0 −14 Original line number Diff line number Diff line Loading @@ -76,7 +76,6 @@ import com.android.settingslib.search.SearchIndexableRaw; import com.google.common.truth.Correspondence; import org.bouncycastle.util.Arrays; import org.junit.After; import org.junit.Before; import org.junit.Rule; Loading Loading @@ -1096,26 +1095,13 @@ public class ToggleScreenMagnificationPreferenceFragmentTest { enabled ? ON : OFF); } private static void addShadowInputDeviceId(int deviceId) { if (ShadowInputDevice.sDeviceIds == null) { ShadowInputDevice.sDeviceIds = new int[]{deviceId}; } else { int curLength = ShadowInputDevice.sDeviceIds.length; ShadowInputDevice.sDeviceIds = Arrays.copyOf(ShadowInputDevice.sDeviceIds, curLength + 1); ShadowInputDevice.sDeviceIds[curLength] = deviceId; } } private static void addMouseDevice() { addShadowInputDeviceId(SHADOW_MOUSE_DEVICE_ID); InputDevice device = ShadowInputDevice .makeInputDevicebyIdWithSources(SHADOW_MOUSE_DEVICE_ID, InputDevice.SOURCE_MOUSE); ShadowInputDevice.addDevice(SHADOW_MOUSE_DEVICE_ID, device); } private static void addKeyboardDevice() { addShadowInputDeviceId(SHADOW_KEYBOARD_DEVICE_ID); InputDevice device = ShadowInputDevice .makeFullKeyboardInputDevicebyId(SHADOW_KEYBOARD_DEVICE_ID); ShadowInputDevice.addDevice(SHADOW_KEYBOARD_DEVICE_ID, device); Loading
tests/robotests/src/com/android/settings/inputmethod/ActionCornerPreferenceControllerTest.java +0 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,6 @@ public class ActionCornerPreferenceControllerTest { private void addTouchpad() { int deviceId = 1; ShadowInputDevice.sDeviceIds = new int[]{deviceId}; InputDevice device = ShadowInputDevice.makeInputDevicebyIdWithSources(deviceId, InputDevice.SOURCE_TOUCHPAD); ShadowInputDevice.addDevice(deviceId, device); Loading
tests/robotests/src/com/android/settings/inputmethod/MouseSettingsControllerTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -67,7 +67,6 @@ public class MouseSettingsControllerTest { @DisableFlags(Flags.FLAG_KEYBOARD_AND_TOUCHPAD_A11Y_NEW_PAGE_ENABLED) public void getAvailabilityStatus_flagIsDisable_returnsUnavailable() { int deviceId = 1; ShadowInputDevice.sDeviceIds = new int[]{deviceId}; ShadowInputDevice.addDevice(deviceId, ShadowInputDevice.makeInputDevicebyId(deviceId)); assertThat(mController.getAvailabilityStatus()) .isEqualTo(BasePreferenceController.CONDITIONALLY_UNAVAILABLE); Loading @@ -77,7 +76,6 @@ public class MouseSettingsControllerTest { @EnableFlags(Flags.FLAG_KEYBOARD_AND_TOUCHPAD_A11Y_NEW_PAGE_ENABLED) public void getAvailabilityStatus_isMouse_returnsAvailable() { int deviceId = 1; ShadowInputDevice.sDeviceIds = new int[]{deviceId}; InputDevice device = ShadowInputDevice.makeInputDevicebyIdWithSources(deviceId, InputDevice.SOURCE_MOUSE); ShadowInputDevice.addDevice(deviceId, device); Loading
tests/robotests/src/com/android/settings/inputmethod/PhysicalKeyboardA11yPreferenceControllerTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -67,7 +67,6 @@ public class PhysicalKeyboardA11yPreferenceControllerTest { @EnableFlags(Flags.FLAG_KEYBOARD_AND_TOUCHPAD_A11Y_NEW_PAGE_ENABLED) public void getAvailabilityStatus_expected() { int deviceId = 1; ShadowInputDevice.sDeviceIds = new int[]{deviceId}; when(mInputDevice.isVirtual()).thenReturn(false); when(mInputDevice.isFullKeyboard()).thenReturn(true); Loading @@ -83,7 +82,6 @@ public class PhysicalKeyboardA11yPreferenceControllerTest { @EnableFlags(Flags.FLAG_KEYBOARD_AND_TOUCHPAD_A11Y_NEW_PAGE_ENABLED) public void getAvailabilityStatus_deviceIsNotAsExpected_unavailable() { int deviceId = 1; ShadowInputDevice.sDeviceIds = new int[]{deviceId}; when(mInputDevice.isVirtual()).thenReturn(true); when(mInputDevice.isFullKeyboard()).thenReturn(false); Loading
tests/robotests/src/com/android/settings/inputmethod/PhysicalKeyboardPreferenceControllerTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -107,7 +107,6 @@ public class PhysicalKeyboardPreferenceControllerTest { @Test @Config(shadows = ShadowInputDevice.class) public void updateState_noKeyboard_setPreferenceVisibleFalse() { ShadowInputDevice.sDeviceIds = new int[0]; mController.updateState(mPreference); verify(mPreference).setVisible(false); Loading @@ -120,7 +119,6 @@ public class PhysicalKeyboardPreferenceControllerTest { when(device.isVirtual()).thenReturn(false); when(device.isFullKeyboard()).thenReturn(true); when(device.getName()).thenReturn("test_keyboard"); ShadowInputDevice.sDeviceIds = new int[]{0}; ShadowInputDevice.addDevice(0, device); mController.updateState(mPreference); Loading