FileDocCategorySizeDatePackage
StateListDrawableTest.javaAPI DocAndroid 1.5 API3184Wed May 06 22:42:02 BST 2009android.graphics.drawable

StateListDrawableTest

public class StateListDrawableTest extends TestCase
Tests for StateListDrawable

Fields Summary
private StateListDrawable
slDrawable
private MockDrawable
mockFocusedDrawable
private MockDrawable
mockCheckedDrawable
private android.view.MockView
mockView
private MockDrawable
mockDefaultDrawable
Constructors Summary
Methods Summary
public voidbroken_testFocusScenarioSetStringWildcardFirst()

        int focusedStateSet[] = {R.attr.state_focused};
        int checkedStateSet[] = {R.attr.state_checked};
        slDrawable.addState(StateSet.WILD_CARD,
                               mockDefaultDrawable);
        slDrawable.addState(checkedStateSet, mockCheckedDrawable);
        slDrawable.addState(focusedStateSet, mockFocusedDrawable);
        mockView.requestFocus();
        mockView.getBackground().draw(null);
        assertTrue(mockDefaultDrawable.wasDrawn);
    
public voidbroken_testFocusScenarioStateSetWildcardLast()

        int focusedStateSet[] = {R.attr.state_focused};
        int checkedStateSet[] = {R.attr.state_checked};
        slDrawable.addState(checkedStateSet, mockCheckedDrawable);
        slDrawable.addState(focusedStateSet, mockFocusedDrawable);
        slDrawable.addState(StateSet.WILD_CARD,
                               mockDefaultDrawable);
        mockView.requestFocus();
        mockView.getBackground().draw(null);
        assertTrue(mockFocusedDrawable.wasDrawn);
    
protected voidsetUp()

        super.setUp();
        slDrawable = new StateListDrawable();
        mockFocusedDrawable = new MockDrawable();
        mockCheckedDrawable = new MockDrawable();
        mockDefaultDrawable = new MockDrawable();
        mockView = new MockView();
        mockView.setBackgroundDrawable(slDrawable);