FileDocCategorySizeDatePackage
AdjacentListsWithAdjacentISVsInsideTest.javaAPI DocAndroid 1.5 API3473Wed May 06 22:42:02 BST 2009com.android.frameworktest.listview.focus

AdjacentListsWithAdjacentISVsInsideTest

public class AdjacentListsWithAdjacentISVsInsideTest extends android.test.ActivityInstrumentationTestCase

Fields Summary
private android.widget.ListView
mLeftListView
private com.android.frameworktest.util.InternalSelectionView
mLeftIsv
private com.android.frameworktest.util.InternalSelectionView
mLeftMiddleIsv
private android.widget.ListView
mRightListView
private com.android.frameworktest.util.InternalSelectionView
mRightMiddleIsv
private com.android.frameworktest.util.InternalSelectionView
mRightIsv
Constructors Summary
public AdjacentListsWithAdjacentISVsInsideTest()

        super("com.android.frameworktest", AdjacentListsWithAdjacentISVsInside.class);
    
Methods Summary
protected voidsetUp()

        super.setUp();
        final AdjacentListsWithAdjacentISVsInside a = getActivity();
        mLeftListView = a.getLeftListView();
        mLeftIsv = a.getLeftIsv();
        mLeftMiddleIsv = a.getLeftMiddleIsv();
        mRightListView = a.getRightListView();
        mRightMiddleIsv = a.getRightMiddleIsv();
        mRightIsv = a.getRightIsv();
    
public voidtestFocusTransfersOutsideOfListWhenNoCandidateInsideHorizontal()

        sendKeys(KeyEvent.KEYCODE_DPAD_DOWN, KeyEvent.KEYCODE_DPAD_DOWN, KeyEvent.KEYCODE_DPAD_RIGHT);

        assertTrue(mLeftListView.hasFocus());
        assertTrue(mLeftMiddleIsv.isFocused());
        assertEquals(2, mLeftMiddleIsv.getSelectedRow());

        sendKeys(KeyEvent.KEYCODE_DPAD_RIGHT);
        assertTrue("mRightListView.hasFocus()", mRightListView.hasFocus());
        assertTrue("mRightMiddleIsv.isFocused()", mRightMiddleIsv.isFocused());
        assertEquals("mRightMiddleIsv.getSelectedRow()", 2, mRightMiddleIsv.getSelectedRow());  
    
public voidtestFocusedRectAndFocusHintWorkWithinListItemHorizontal()
rockinist test name to date!

        sendKeys(KeyEvent.KEYCODE_DPAD_DOWN);
        assertEquals(1, mLeftIsv.getSelectedRow());

        sendKeys(KeyEvent.KEYCODE_DPAD_RIGHT);
        assertTrue(mLeftListView.hasFocus());
        assertTrue(mLeftMiddleIsv.isFocused());
        assertEquals("mLeftMiddleIsv.getSelectedRow()", 1, mLeftMiddleIsv.getSelectedRow());

        sendKeys(KeyEvent.KEYCODE_DPAD_LEFT);
        assertTrue(mLeftIsv.isFocused());
        assertEquals("mLeftIsv.getSelectedRow()", 1, mLeftIsv.getSelectedRow());
    
public voidtestPreconditions()

        assertTrue(mLeftListView.hasFocus());
        assertTrue(mLeftIsv.isFocused());
        assertEquals(0, mLeftIsv.getSelectedRow());