FileDocCategorySizeDatePackage
ChangeTouchModeTest.javaAPI DocAndroid 5.1 API4480Thu Mar 12 22:22:12 GMT 2015android.widget.touchmode

ChangeTouchModeTest

public class ChangeTouchModeTest extends android.test.ActivityInstrumentationTestCase
Tests that the touch mode changes from various events, and that the state persists across activities.

Fields Summary
Constructors Summary
public ChangeTouchModeTest()

        super("com.android.frameworks.coretests", LLOfButtons1.class);
    
Methods Summary
public voidDISABLE_testDpadDirectionLeavesTouchMode()

        assertInTouchModeAfterClick(this, getActivity().getFirstButton());
        sendKeys(KeyEvent.KEYCODE_DPAD_RIGHT);
        assertNotInTouchModeAfterKey(this, KeyEvent.KEYCODE_DPAD_RIGHT, getActivity().getFirstButton());
        assertFalse("touch mode", getActivity().isInTouchMode());
    
public voidTODO_touchTrackBallMovementLeavesTouchMode()


    
protected voidsetUp()

        super.setUp();
    
public voidtestPreconditions()

        assertFalse("touch mode", getActivity().isInTouchMode());
    
public voidtestTouchModeChangedInOtherActivity()


        assertFalse("touch mode", getActivity().isInTouchMode());

        LLOfButtons2 otherActivity = null;
        try {
            otherActivity =
                    launchActivity("com.android.frameworks.coretests", LLOfButtons2.class, null);
            assertNotNull(otherActivity);
            assertFalse(otherActivity.isInTouchMode());
            assertInTouchModeAfterClick(this, otherActivity.getFirstButton());
            assertTrue(otherActivity.isInTouchMode());
        } finally {
            if (otherActivity != null) {
                otherActivity.finish();
            }
        }

        // need to wait for async update back to window to occur
        Thread.sleep(200);
        
        assertTrue("touch mode", getActivity().isInTouchMode());
    
public voidtestTouchModeFalseAcrossActivites()


        getInstrumentation().waitForIdleSync();

        LLOfButtons2 otherActivity = null;
        try {
            otherActivity =
                    launchActivity("com.android.frameworks.coretests", LLOfButtons2.class, null);
            assertNotNull(otherActivity);
            assertFalse(otherActivity.isInTouchMode());
        } finally {
            if (otherActivity != null) {
                otherActivity.finish();
            }
        }
    
public voidtestTouchModeTrueAcrossActivites()

        assertInTouchModeAfterClick(this, getActivity().getFirstButton());
        LLOfButtons2 otherActivity = null;
        try {
            otherActivity =
                    launchActivity("com.android.frameworks.coretests", LLOfButtons2.class, null);
            assertNotNull(otherActivity);
            assertTrue(otherActivity.isInTouchMode());
        } finally {
            if (otherActivity != null) {
                otherActivity.finish();
            }
        }
    
public voidtestTouchingScreenEntersTouchMode()

        assertInTouchModeAfterTap(this, getActivity().getFirstButton());
        assertTrue("touch mode", getActivity().isInTouchMode());