FileDocCategorySizeDatePackage
ListWithFirstScreenUnSelectableTest.javaAPI DocAndroid 1.5 API2291Wed May 06 22:42:02 BST 2009com.android.frameworktest.listview.arrowscroll

ListWithFirstScreenUnSelectableTest

public class ListWithFirstScreenUnSelectableTest extends android.test.ActivityInstrumentationTestCase2

Fields Summary
private android.widget.ListView
mListView
Constructors Summary
public ListWithFirstScreenUnSelectableTest()

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

        super.setUp();

        setActivityInitialTouchMode(true);

        mListView = getActivity().getListView();
    
public voidtestPreconditions()

        assertTrue(mListView.isInTouchMode());
        assertEquals(1, mListView.getChildCount());
        assertFalse(mListView.getAdapter().isEnabled(0));
        assertEquals(AdapterView.INVALID_POSITION, mListView.getSelectedItemPosition());
    
public voidtestRessurectSelection()

        sendKeys(KeyEvent.KEYCODE_SPACE);
        assertEquals(AdapterView.INVALID_POSITION, mListView.getSelectedItemPosition());
    
public voidtestScrollDownPansNextItemOn()

        sendKeys(KeyEvent.KEYCODE_DPAD_DOWN);
        assertEquals(2, mListView.getChildCount());
    
public voidtestScrollUpDoesNothing()

        sendKeys(KeyEvent.KEYCODE_DPAD_UP);
        assertEquals(AdapterView.INVALID_POSITION, mListView.getSelectedItemPosition());
        assertEquals(1, mListView.getChildCount());
        assertEquals(0, mListView.getFirstVisiblePosition());