FileDocCategorySizeDatePackage
ListHeterogeneousTest.javaAPI DocAndroid 1.5 API2375Wed May 06 22:42:02 BST 2009com.android.frameworktest.listview

ListHeterogeneousTest

public class ListHeterogeneousTest extends android.test.ActivityInstrumentationTestCase

Fields Summary
private com.android.frameworktest.listview.ListHeterogeneous
mActivity
private android.widget.ListView
mListView
Constructors Summary
public ListHeterogeneousTest()

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

        super.setUp();

        mActivity = getActivity();
        mListView = getActivity().getListView();
    
public voidtestKeyScrolling()

        Instrumentation inst = getInstrumentation();
        
        int count = mListView.getAdapter().getCount();

        
        for (int i = 0; i < count - 1; i++) {
            inst.sendCharacterSync(KeyEvent.KEYCODE_DPAD_DOWN);
        }
        inst.waitForIdleSync();
        int convertMissesBefore = mActivity.getConvertMisses();
        
        assertEquals("Unexpected convert misses", 0, convertMissesBefore);
        
        for (int i = 0; i < count - 1; i++) {
            inst.sendCharacterSync(KeyEvent.KEYCODE_DPAD_UP);
        }
        inst.waitForIdleSync();
        int convertMissesAfter = mActivity.getConvertMisses();
        
        assertEquals("Unexpected convert misses", 0, convertMissesAfter);
    
public voidtestPreconditions()

        assertNotNull(mActivity);
        assertNotNull(mListView);