Methods Summary |
---|
public void | setUp()
super.setUp();
final Visibility a = getActivity();
mRefUp = (TextView) a.findViewById(R.id.refUp);
mRefDown = (TextView) a.findViewById(R.id.refDown);
mVictim = (TextView) a.findViewById(R.id.victim);
mVisible = (Button) a.findViewById(R.id.vis);
mInvisible = (Button) a.findViewById(R.id.invis);
mGone = (Button) a.findViewById(R.id.gone);
|
public void | testGoneToInvisible()
sendKeys("2*DPAD_RIGHT");
assertTrue(mGone.hasFocus());
int oldTop = mVictim.getTop();
sendKeys("DPAD_CENTER");
assertEquals(View.GONE, mVictim.getVisibility());
int refDownTop = mRefDown.getTop();
assertEquals(oldTop, refDownTop);
sendKeys(KEYCODE_DPAD_LEFT, KEYCODE_DPAD_CENTER);
assertEquals(View.INVISIBLE, mVictim.getVisibility());
int newTop = mVictim.getTop();
assertEquals(oldTop, newTop);
|
public void | testGoneToVisible()
sendKeys("2*DPAD_RIGHT");
assertTrue(mGone.hasFocus());
int oldTop = mVictim.getTop();
sendKeys("DPAD_CENTER");
assertEquals(View.GONE, mVictim.getVisibility());
int refDownTop = mRefDown.getTop();
assertEquals(oldTop, refDownTop);
sendKeys("2*DPAD_LEFT DPAD_CENTER");
assertEquals(View.VISIBLE, mVictim.getVisibility());
int newTop = mVictim.getTop();
assertEquals(oldTop, newTop);
|
public void | testInvisibleToGone()
sendKeys("DPAD_RIGHT");
assertTrue(mInvisible.hasFocus());
int oldTop = mVictim.getTop();
sendKeys("DPAD_CENTER");
assertEquals(View.INVISIBLE, mVictim.getVisibility());
int newTop = mVictim.getTop();
assertEquals(oldTop, newTop);
sendKeys("DPAD_RIGHT DPAD_CENTER");
assertEquals(View.GONE, mVictim.getVisibility());
int refDownTop = mRefDown.getTop();
assertEquals(oldTop, refDownTop);
|
public void | testInvisibleToVisible()
sendKeys("DPAD_RIGHT");
assertTrue(mInvisible.hasFocus());
int oldTop = mVictim.getTop();
sendKeys("DPAD_CENTER");
assertEquals(View.INVISIBLE, mVictim.getVisibility());
int newTop = mVictim.getTop();
assertEquals(oldTop, newTop);
sendKeys("DPAD_LEFT DPAD_CENTER");
assertEquals(View.VISIBLE, mVictim.getVisibility());
newTop = mVictim.getTop();
assertEquals(oldTop, newTop);
|
public void | testSetUpConditions()
assertNotNull(mRefUp);
assertNotNull(mRefDown);
assertNotNull(mVictim);
assertNotNull(mVisible);
assertNotNull(mInvisible);
assertNotNull(mGone);
assertTrue(mVisible.hasFocus());
|
public void | testVisibleToGone()
//sendKeys("2*DPAD_RIGHT");
sendRepeatedKeys(2, KEYCODE_DPAD_RIGHT);
assertTrue(mGone.hasFocus());
int oldTop = mVictim.getTop();
sendKeys("DPAD_CENTER");
assertEquals(View.GONE, mVictim.getVisibility());
int refDownTop = mRefDown.getTop();
assertEquals(oldTop, refDownTop);
|
public void | testVisibleToInvisible()
sendKeys("DPAD_RIGHT");
assertTrue(mInvisible.hasFocus());
int oldTop = mVictim.getTop();
sendKeys("DPAD_CENTER");
assertEquals(View.INVISIBLE, mVictim.getVisibility());
int newTop = mVictim.getTop();
assertEquals(oldTop, newTop);
|