FileDocCategorySizeDatePackage
AddColumnTest.javaAPI DocAndroid 5.1 API2330Thu Mar 12 22:22:12 GMT 2015android.widget.layout.table

AddColumnTest

public class AddColumnTest extends android.test.ActivityInstrumentationTestCase
{@link android.widget.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.frameworks.coretests", 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());
        }