30 public
void returnsOuterContextInputMethodManager() {
43 Context context = spy(ApplicationProvider.getApplicationContext());
44 InputMethodManager expected = mock(InputMethodManager.class);
45 when(context.getSystemService(
Context.INPUT_METHOD_SERVICE)).thenReturn(expected);
46 DisplayManager dm = (DisplayManager) context.getSystemService(
Context.DISPLAY_SERVICE);
51 InputMethodManager actual =
52 (InputMethodManager) svp.getContext().getSystemService(
Context.INPUT_METHOD_SERVICE);
56 assertEquals(expected, actual);
61 public
void returnsOuterContextInputMethodManager_createDisplayContext() {
65 Context context = spy(ApplicationProvider.getApplicationContext());
66 InputMethodManager expected = mock(InputMethodManager.class);
67 when(context.getSystemService(
Context.INPUT_METHOD_SERVICE)).thenReturn(expected);
69 ((DisplayManager) context.getSystemService(
Context.DISPLAY_SERVICE)).getDisplay(0);
74 InputMethodManager actual =
77 .createDisplayContext(display)
78 .getSystemService(
Context.INPUT_METHOD_SERVICE);
82 assertEquals(expected, actual);