use of android.test.suitebuilder.annotation.LargeTest in project android_frameworks_base by ParanoidAndroid.
the class ListManagedCursorTest method testTouchScrollingToTrackballMode.
/**
* Scroll the list using touch, launch new activity, change to trackball mode, hit back, make
* sure we're still scrolled.
*/
@FlakyTest(tolerance = 3)
@LargeTest
public void testTouchScrollingToTrackballMode() {
Instrumentation inst = getInstrumentation();
int firstVisiblePosition = touchScroll(inst);
inst.sendCharacterSync(KeyEvent.KEYCODE_DPAD_DOWN);
inst.waitForIdleSync();
inst.sendCharacterSync(KeyEvent.KEYCODE_DPAD_DOWN);
inst.waitForIdleSync();
inst.sendCharacterSync(KeyEvent.KEYCODE_BACK);
inst.waitForIdleSync();
assertTrue("List not in trackball mode", !mListView.isInTouchMode());
assertTrue("List did not preserve scroll position", firstVisiblePosition == mListView.getFirstVisiblePosition());
}
use of android.test.suitebuilder.annotation.LargeTest in project android_frameworks_base by ParanoidAndroid.
the class ListManagedCursorTest method testKeyScrolling.
/**
* Scroll the list using arrows, launch new activity, hit back, make sure we're still scrolled.
*/
@LargeTest
public void testKeyScrolling() {
Instrumentation inst = getInstrumentation();
int firstVisiblePosition = arrowScroll(inst);
inst.sendCharacterSync(KeyEvent.KEYCODE_BACK);
inst.waitForIdleSync();
assertTrue("List changed to touch mode", !mListView.isInTouchMode());
assertTrue("List did not preserve scroll position", firstVisiblePosition == mListView.getFirstVisiblePosition());
}
use of android.test.suitebuilder.annotation.LargeTest in project android_frameworks_base by ParanoidAndroid.
the class ListScrollListenerTest method testKeyScrolling.
@LargeTest
public void testKeyScrolling() {
Instrumentation inst = getInstrumentation();
int firstVisibleItem = mFirstVisibleItem;
for (int i = 0; i < mVisibleItemCount * 2; i++) {
inst.sendCharacterSync(KeyEvent.KEYCODE_DPAD_DOWN);
}
inst.waitForIdleSync();
assertTrue("Arrow scroll did not happen", mFirstVisibleItem > firstVisibleItem);
firstVisibleItem = mFirstVisibleItem;
inst.sendCharacterSync(KeyEvent.KEYCODE_SPACE);
inst.waitForIdleSync();
assertTrue("Page scroll did not happen", mFirstVisibleItem > firstVisibleItem);
firstVisibleItem = mFirstVisibleItem;
KeyEvent down = new KeyEvent(0, 0, KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DPAD_DOWN, 0, KeyEvent.META_ALT_ON);
KeyEvent up = new KeyEvent(0, 0, KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DPAD_DOWN, 0, KeyEvent.META_ALT_ON);
inst.sendKeySync(down);
inst.sendKeySync(up);
inst.waitForIdleSync();
assertTrue("Full scroll did not happen", mFirstVisibleItem > firstVisibleItem);
assertEquals("Full scroll did not happen", mTotalItemCount, mFirstVisibleItem + mVisibleItemCount);
}
use of android.test.suitebuilder.annotation.LargeTest in project android_frameworks_base by ParanoidAndroid.
the class TextViewWordLimitsTest method testNotIncluded.
/**
* Unicode classes other than listed in testIncludedClasses and
* testPartlyIncluded act as word separators.
*/
@LargeTest
public void testNotIncluded() throws Exception {
// Selection of character classes excluded
// a Combining ring above
final String MARK_NONSPACING = "å";
// Parenthesis
final String PUNCTUATION_OPEN_CLOSE = "(c)";
// Hyphen
final String PUNCTUATION_DASH = "non-fiction";
// Ampersand
final String PUNCTUATION_OTHER = "b&b";
// Registered
final String SYMBOL_OTHER = "Android®";
// Space
final String SEPARATOR_SPACE = "one two";
// "a"
verifyWordLimits(MARK_NONSPACING, 1, 0, 1);
// "c"
verifyWordLimits(PUNCTUATION_OPEN_CLOSE, 1, 1, 2);
// "non-"
verifyWordLimits(PUNCTUATION_DASH, 3, 0, 3);
verifyWordLimits(PUNCTUATION_DASH, 4, 4, 11);
// "b"
verifyWordLimits(PUNCTUATION_OTHER, 0, 0, 1);
verifyWordLimits(PUNCTUATION_OTHER, 1, 0, 1);
// & is considered a punctuation sign.
verifyWordLimits(PUNCTUATION_OTHER, 2, 0, 3);
verifyWordLimits(PUNCTUATION_OTHER, 3, 2, 3);
// "Android"
verifyWordLimits(SYMBOL_OTHER, 7, 0, 7);
verifyWordLimits(SYMBOL_OTHER, 8, -1, -1);
// "one"
verifyWordLimits(SEPARATOR_SPACE, 1, 0, 3);
}
use of android.test.suitebuilder.annotation.LargeTest in project android_frameworks_base by ParanoidAndroid.
the class TextViewWordLimitsTest method testPartlyIncluded.
/**
* Unicode classes included if combined with a letter.
*/
@LargeTest
public void testPartlyIncluded() throws Exception {
final String NUMBER = "123";
final String NUMBER_LOWER = "1st";
final String APOSTROPHE = "''";
final String APOSTROPHE_LOWER = "'Android's'";
// Pure decimal number is ignored
verifyWordLimits(NUMBER, 1, -1, -1);
// Number with letter is valid
verifyWordLimits(NUMBER_LOWER, 1, 0, 3);
// Stand apostrophes are ignore
verifyWordLimits(APOSTROPHE, 1, -1, -1);
// Apostrophes are accepted if they are a part of a word
verifyWordLimits(APOSTROPHE_LOWER, 1, 0, 11);
}
Aggregations