Search in sources :

Example 31 with LargeTest

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());
}
Also used : Instrumentation(android.app.Instrumentation) FlakyTest(android.test.FlakyTest) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Example 32 with LargeTest

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());
}
Also used : Instrumentation(android.app.Instrumentation) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Example 33 with LargeTest

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);
}
Also used : KeyEvent(android.view.KeyEvent) Instrumentation(android.app.Instrumentation) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Example 34 with LargeTest

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);
}
Also used : SpannableString(android.text.SpannableString) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Example 35 with LargeTest

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);
}
Also used : SpannableString(android.text.SpannableString) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Aggregations

LargeTest (android.test.suitebuilder.annotation.LargeTest)1579 AudioEffect (android.media.audiofx.AudioEffect)234 AudioTrack (android.media.AudioTrack)222 View (android.view.View)147 File (java.io.File)144 MediaVideoItem (android.media.videoeditor.MediaVideoItem)115 Uri (android.net.Uri)99 ListView (android.widget.ListView)72 Cursor (android.database.Cursor)69 Bitmap (android.graphics.Bitmap)62 Instrumentation (android.app.Instrumentation)61 MediaPlayer (android.media.MediaPlayer)60 WifiConfiguration (android.net.wifi.WifiConfiguration)53 SurfaceHolder (android.view.SurfaceHolder)50 MediaImageItem (android.media.videoeditor.MediaImageItem)49 IOException (java.io.IOException)48 AudioManager (android.media.AudioManager)42 LegacyVpnInfo (com.android.internal.net.LegacyVpnInfo)42 VpnProfile (com.android.internal.net.VpnProfile)42 Request (android.app.DownloadManager.Request)41