@Test public void testLongClickWithTwoOptions_shouldDoNothing() { OptionScanSelectionNode superParentNode = new OptionScanSelectionNode(mSelectionNode, mSelectionNode); mOptionManager.clearFocusIfNewTree(superParentNode); mOptionManager.selectOption(0); mOptionManager.performLongClick(); assertEquals(0, mShadowInfo1.getPerformedActions().size()); assertEquals(0, mShadowInfo2.getPerformedActions().size()); }
@Test public void testLongClickWithOneOptionThatSucceeds_shouldLongClickAndClearFocus() { mOptionManager.clearFocusIfNewTree(mSelectionNode); mOptionManager.selectOption(0); mOptionManager.performLongClick(); List<Integer> info1Actions = mShadowInfo1.getPerformedActions(); assertEquals(1, info1Actions.size()); assertEquals(new Integer(AccessibilityNodeInfoCompat.ACTION_LONG_CLICK), info1Actions.get(0)); verify(mOverlayController, times(3)).clearOverlay(); }