Methods Summary |
---|
public void | assertSelectedViewFocus(boolean isFocused)
final View view = mListView.getSelectedView();
assertEquals("selected view focused", isFocused, view.isFocused());
assertEquals("selected position's isSelected should be the inverse "
+ "of it having focus", !isFocused, view.isSelected());
|
protected void | setUp()
super.setUp();
mListView = getActivity().getListView();
mListUtil = new ListUtil(mListView, getInstrumentation());
|
public void | testGoingDownFromFocusableToUnfocusableWhenFocusableIsBelow()Go down from a focusable when there is a focusable below, but it is more than
one item away; make sure it won't give that item focus because it is too far away.
mListUtil.setSelectedPosition(3);
sendKeys(KeyEvent.KEYCODE_DPAD_DOWN);
assertEquals("selected item position", 4, mListView.getSelectedItemPosition());
assertSelectedViewFocus(false);
|
public void | testGoingDownFromUnFocusableSelectedToFocusableWithOtherFocusableAbove()
mListUtil.setSelectedPosition(2);
sendKeys(KeyEvent.KEYCODE_DPAD_DOWN);
assertEquals("selected item position", 3, mListView.getSelectedItemPosition());
assertSelectedViewFocus(true);
|
public void | testGoingFromUnFocusableSelectedToFocusable()
sendKeys(KeyEvent.KEYCODE_DPAD_DOWN);
assertEquals("selected item position", 1, mListView.getSelectedItemPosition());
assertSelectedViewFocus(true);
|
public void | testGoingUpFromFocusableToUnfocusableWhenFocusableIsBelow()
mListUtil.setSelectedPosition(6);
sendKeys(KeyEvent.KEYCODE_DPAD_UP);
assertEquals("selected item position", 5, mListView.getSelectedItemPosition());
assertSelectedViewFocus(false);
|
public void | testGoingUpFromUnFocusableSelectedToFocusableWithOtherFocusableAbove()
mListUtil.setSelectedPosition(2);
sendKeys(KeyEvent.KEYCODE_DPAD_UP);
assertEquals("selected item position", 1, mListView.getSelectedItemPosition());
assertSelectedViewFocus(true);
|
public void | testPreconditions()
assertEquals(7, mListView.getChildCount());
assertTrue(mListView.getChildAt(1).isFocusable());
assertTrue(mListView.getChildAt(3).isFocusable());
assertTrue(mListView.getChildAt(6).isFocusable());
|