Loading tests/robotests/src/com/android/settings/connecteddevice/stylus/StylusDevicesControllerTest.java +7 −1 Original line number Diff line number Diff line Loading @@ -108,6 +108,9 @@ public class StylusDevicesControllerTest { MockitoAnnotations.initMocks(this); mContext = spy(ApplicationProvider.getApplicationContext()); final var spiedResources = spy(mContext.getResources()); when(mContext.getResources()).thenReturn(spiedResources); PreferenceManager preferenceManager = new PreferenceManager(mContext); mScreen = preferenceManager.createPreferenceScreen(mContext); mPreferenceContainer = new PreferenceCategory(mContext); Loading Loading @@ -144,6 +147,9 @@ public class StylusDevicesControllerTest { when(mInputDevice.hasKeys(KEYCODE_STYLUS_BUTTON_TAIL)).thenReturn( new boolean[]{true}); when(spiedResources.getBoolean( com.android.internal.R.bool.config_enableStylusPointerIcon)).thenReturn(true); mController = new StylusDevicesController(mContext, mInputDevice, null, mLifecycle); } Loading Loading @@ -237,7 +243,7 @@ public class StylusDevicesControllerTest { Preference handwritingPref = mPreferenceContainer.getPreference(0); Preference buttonPref = mPreferenceContainer.getPreference(1); assertThat(mPreferenceContainer.getPreferenceCount()).isEqualTo(2); assertThat(mPreferenceContainer.getPreferenceCount()).isEqualTo(3); assertThat(handwritingPref.getTitle().toString()).isEqualTo( mContext.getString(R.string.stylus_textfield_handwriting)); assertThat(handwritingPref.isVisible()).isTrue(); Loading Loading
tests/robotests/src/com/android/settings/connecteddevice/stylus/StylusDevicesControllerTest.java +7 −1 Original line number Diff line number Diff line Loading @@ -108,6 +108,9 @@ public class StylusDevicesControllerTest { MockitoAnnotations.initMocks(this); mContext = spy(ApplicationProvider.getApplicationContext()); final var spiedResources = spy(mContext.getResources()); when(mContext.getResources()).thenReturn(spiedResources); PreferenceManager preferenceManager = new PreferenceManager(mContext); mScreen = preferenceManager.createPreferenceScreen(mContext); mPreferenceContainer = new PreferenceCategory(mContext); Loading Loading @@ -144,6 +147,9 @@ public class StylusDevicesControllerTest { when(mInputDevice.hasKeys(KEYCODE_STYLUS_BUTTON_TAIL)).thenReturn( new boolean[]{true}); when(spiedResources.getBoolean( com.android.internal.R.bool.config_enableStylusPointerIcon)).thenReturn(true); mController = new StylusDevicesController(mContext, mInputDevice, null, mLifecycle); } Loading Loading @@ -237,7 +243,7 @@ public class StylusDevicesControllerTest { Preference handwritingPref = mPreferenceContainer.getPreference(0); Preference buttonPref = mPreferenceContainer.getPreference(1); assertThat(mPreferenceContainer.getPreferenceCount()).isEqualTo(2); assertThat(mPreferenceContainer.getPreferenceCount()).isEqualTo(3); assertThat(handwritingPref.getTitle().toString()).isEqualTo( mContext.getString(R.string.stylus_textfield_handwriting)); assertThat(handwritingPref.isVisible()).isTrue(); Loading