FileDocCategorySizeDatePackage
FocusableInTouchModeClickTest.javaAPI DocAndroid 1.5 API2407Wed May 06 22:42:02 BST 2009com.android.frameworktest.touchmode

FocusableInTouchModeClickTest

public class FocusableInTouchModeClickTest extends android.test.ActivityInstrumentationTestCase2

Fields Summary
Constructors Summary
public FocusableInTouchModeClickTest()

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

        super.setUp();
        setActivityInitialTouchMode(true);
    
public voidtestClickGivesFocusNoClickFired()

        TouchUtils.clickView(this, getActivity().getButton2());
        assertTrue("click should give focusable in touch mode focus",
                getActivity().getButton2().isFocused());
        assertFalse("getting focus should result in no on click",
                getActivity().isB2Fired());

        TouchUtils.clickView(this, getActivity().getButton2());
        assertTrue("subsequent click while focused should fire on click",
                getActivity().isB2Fired());
    
public voidtestPreconditions()

        assertTrue("should start in touch mode", getActivity().getButton1().isInTouchMode());
        assertTrue(getActivity().getButton1().isFocused());
    
public voidtestTapGivesFocusNoClickFired()

        TouchUtils.touchAndCancelView(this, getActivity().getButton2());
        assertFalse("button shouldn't have fired click", getActivity().isB2Fired());
        assertFalse("button shouldn't have focus", getActivity().getButton2().isFocused());