@MediumTest public void testGoingRightFromLeftButtonJumpsOverCenterToRight() { sendKeys(KeyEvent.KEYCODE_DPAD_RIGHT); assertTrue("right button should be focused", mRightButton.isFocused()); }
@MediumTest public void testGoingRightFromLeftButtonJumpsOverCenterToRight() { sendKeys(KeyEvent.KEYCODE_DPAD_RIGHT); assertTrue("right button should be focused", mRightButton.isFocused()); }
@MediumTest public void testGoingLeftFromRightButtonGoesToCenter() { // Give right button focus by having it request focus. We post it // to the UI thread because we are not running on the same thread, and // any direct api calls that change state must be made from the UI thread. // This is in contrast to instrumentation calls that send events that are // processed through the framework and eventually find their way to // affecting the ui thread. getActivity().runOnUiThread(new Runnable() { public void run() { mRightButton.requestFocus(); } }); // wait for the request to go through getInstrumentation().waitForIdleSync(); assertTrue(mRightButton.isFocused()); sendKeys(KeyEvent.KEYCODE_DPAD_LEFT); assertTrue("center button should be focused", mCenterButton.isFocused()); } }
@MediumTest public void testGoingLeftFromRightButtonGoesToCenter() { // Give right button focus by having it request focus. We post it // to the UI thread because we are not running on the same thread, and // any direct api calls that change state must be made from the UI thread. // This is in contrast to instrumentation calls that send events that are // processed through the framework and eventually find their way to // affecting the ui thread. getActivity().runOnUiThread(new Runnable() { public void run() { mRightButton.requestFocus(); } }); // wait for the request to go through getInstrumentation().waitForIdleSync(); assertTrue(mRightButton.isFocused()); sendKeys(KeyEvent.KEYCODE_DPAD_LEFT); assertTrue("center button should be focused", mCenterButton.isFocused()); } }