ListRetainsFocusAcrossLayoutsTestpublic class ListRetainsFocusAcrossLayoutsTest extends android.test.ActivityInstrumentationTestCase
Constructors Summary |
---|
public ListRetainsFocusAcrossLayoutsTest()
super("com.android.frameworks.coretests", ListItemFocusablesClose.class);
|
Methods Summary |
---|
private void | requestLayoutOnList()
getActivity().runOnUiThread(new Runnable() {
public void run() {
getActivity().getListView().requestLayout();
}
});
| public void | testBottomButtonOfSecondPositionRetainsFocusAfterLayout()
sendRepeatedKeys(3, KeyEvent.KEYCODE_DPAD_DOWN);
assertTrue("bottom botton at position 1 should be focused",
getActivity().getChildOfItem(1, 2).isFocused());
requestLayoutOnList();
getInstrumentation().waitForIdleSync();
assertTrue("bottom botton at position 1 should be focused after layout",
getActivity().getChildOfItem(1, 2).isFocused());
| public void | testBottomButtonRetainsFocusAfterLayout()
sendKeys(KeyEvent.KEYCODE_DPAD_DOWN);
assertTrue("bottom botton at position 0 should be focused",
getActivity().getChildOfItem(0, 2).isFocused());
requestLayoutOnList();
getInstrumentation().waitForIdleSync();
assertTrue("bottom botton at position 0 should be focused after layout",
getActivity().getChildOfItem(0, 2).isFocused());
| public void | testPreconditions()
assertTrue("top button at position 0 should be focused",
getActivity().getChildOfItem(0, 0).isFocused());
| public void | testTopButtonOfSecondPositionRetainsFocusAfterLayout()
sendRepeatedKeys(2, KeyEvent.KEYCODE_DPAD_DOWN);
assertTrue("top botton at position 1 should be focused",
getActivity().getChildOfItem(1, 0).isFocused());
requestLayoutOnList();
getInstrumentation().waitForIdleSync();
assertTrue("top botton at position 1 should be focused after layout",
getActivity().getChildOfItem(1, 0).isFocused());
|
|