GlobalFocusChangeTestpublic class GlobalFocusChangeTest extends android.test.ActivityInstrumentationTestCase
Fields Summary |
---|
private GlobalFocusChange | mActivity | private android.view.View | mLeft | private android.view.View | mRight |
Constructors Summary |
---|
public GlobalFocusChangeTest()
super("com.android.frameworks.coretests", GlobalFocusChange.class);
|
Methods Summary |
---|
public void | setUp()
super.setUp();
mActivity = getActivity();
mLeft = mActivity.findViewById(R.id.left);
mRight = mActivity.findViewById(R.id.right);
| protected void | tearDown()
mActivity.reset();
super.tearDown();
| public void | testEnterTouchMode()
assertTrue(mLeft.isFocused());
TouchUtils.tapView(this, mLeft);
assertSame(mLeft, mActivity.mOldFocus);
assertSame(null, mActivity.mNewFocus);
| public void | testFocusChange()
sendKeys(KeyEvent.KEYCODE_DPAD_RIGHT);
assertFalse(mLeft.isFocused());
assertTrue(mRight.isFocused());
assertSame(mLeft, mActivity.mOldFocus);
assertSame(mRight, mActivity.mNewFocus);
| public void | testLeaveTouchMode()
assertTrue(mLeft.isFocused());
TouchUtils.tapView(this, mLeft);
sendKeys(KeyEvent.KEYCODE_DPAD_RIGHT);
assertTrue(mLeft.isFocused());
assertSame(null, mActivity.mOldFocus);
assertSame(mLeft, mActivity.mNewFocus);
|
|