FileDocCategorySizeDatePackage
ExpandableListWithHeadersTest.javaAPI DocAndroid 1.5 API2419Wed May 06 22:42:02 BST 2009com.android.frameworktest.expandablelistview

ExpandableListWithHeadersTest

public class ExpandableListWithHeadersTest extends android.test.ActivityInstrumentationTestCase

Fields Summary
private android.widget.ExpandableListView
mExpandableListView
private com.android.frameworktest.util.ListUtil
mListUtil
Constructors Summary
public ExpandableListWithHeadersTest()

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

        super.setUp();
        
        mExpandableListView = getActivity().getExpandableListView();
        mListUtil = new ListUtil(mExpandableListView, getInstrumentation());
    
public voidtestExpandOnFirstGroup()

        mListUtil.arrowScrollToSelectedPosition(getActivity().getNumOfHeadersAndFooters());
        sendKeys(KeyEvent.KEYCODE_DPAD_CENTER);
        getInstrumentation().waitForIdleSync();
        assertTrue(mExpandableListView.isGroupExpanded(0));
    
public voidtestExpandOnFirstPosition()

        // Should be a header, and hence the first group should NOT have expanded
        mListUtil.arrowScrollToSelectedPosition(0);
        sendKeys(KeyEvent.KEYCODE_DPAD_CENTER);
        getInstrumentation().waitForIdleSync();
        assertFalse(mExpandableListView.isGroupExpanded(0));
    
public voidtestPreconditions()

        assertNotNull(mExpandableListView);