FileDocCategorySizeDatePackage
AddColumnTest.javaAPI DocAndroid 1.5 API2349Wed May 06 22:42:02 BST 2009com.android.frameworktest.layout.table

AddColumnTest

public class AddColumnTest extends android.test.ActivityInstrumentationTestCase
{@link com.android.frameworktest.layout.table.AddColumn} is setup to exercise the case of adding row programmatically in a table.

Fields Summary
private android.widget.Button
mAddRow
private android.widget.TableLayout
mTable
Constructors Summary
public AddColumnTest()

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

        super.setUp();

        final AddColumn activity = getActivity();
        mAddRow = (Button) activity.findViewById(R.id.add_row_button);
        mTable = (TableLayout) activity.findViewById(R.id.table);
    
public voidtestSetUpConditions()

        assertNotNull(mAddRow);
        assertNotNull(mTable);
        assertTrue(mAddRow.hasFocus());
    
public voidtestWidths()

        sendKeys(KeyEvent.KEYCODE_DPAD_CENTER);
        getInstrumentation().waitForIdleSync();

        TableRow row1 = (TableRow) mTable.getChildAt(0);
        TableRow row2 = (TableRow) mTable.getChildAt(1);

        assertTrue(row1.getChildCount() < row2.getChildCount());

        for (int i = 0; i < row1.getChildCount(); i++) {
            assertEquals(row2.getChildAt(i).getWidth(), row1.getChildAt(i).getWidth());
        }