Search in sources :

Example 46 with LargeTest

use of android.test.suitebuilder.annotation.LargeTest in project android_frameworks_base by ParanoidAndroid.

the class ListSetSelectionTest method testSetSelection0.

@LargeTest
public void testSetSelection0() {
    TouchUtils.dragQuarterScreenDown(this);
    TouchUtils.dragQuarterScreenDown(this);
    TouchUtils.dragQuarterScreenDown(this);
    // Nothing should be selected
    assertEquals("Selection still available after touch", -1, mListView.getSelectedItemPosition());
    mActivity.runOnUiThread(new Runnable() {

        public void run() {
            mListView.setSelection(0);
        }
    });
    getInstrumentation().waitForIdleSync();
    boolean found = false;
    int childCount = mListView.getChildCount();
    for (int i = 0; i < childCount; i++) {
        View child = mListView.getChildAt(i);
        if (child.getId() == 0 && i == 0) {
            found = true;
            break;
        }
    }
    assertTrue("Selected item not visible in list", found);
}
Also used : View(android.view.View) ListView(android.widget.ListView) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Example 47 with LargeTest

use of android.test.suitebuilder.annotation.LargeTest in project android_frameworks_base by ParanoidAndroid.

the class ListTouchBottomGravityManyTest method testPullDown.

@LargeTest
public void testPullDown() {
    int originalCount = mListView.getChildCount();
    TouchUtils.scrollToTop(this, mListView);
    // Nothing should be selected
    assertEquals("Selection still available after touch", -1, mListView.getSelectedItemPosition());
    View firstChild = mListView.getChildAt(0);
    assertEquals("Item zero not the first child in the list", 0, firstChild.getId());
    assertEquals("Item zero not at the top of the list", mListView.getListPaddingTop(), firstChild.getTop());
    assertTrue(String.format("Too many children created: %d expected no more than %d", mListView.getChildCount(), originalCount + 1), mListView.getChildCount() <= originalCount + 1);
}
Also used : View(android.view.View) ListView(android.widget.ListView) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Example 48 with LargeTest

use of android.test.suitebuilder.annotation.LargeTest in project android_frameworks_base by ParanoidAndroid.

the class ListTouchManyTest method testLongPress.

@LargeTest
public void testLongPress() {
    int i;
    int count = mListView.getChildCount();
    mActivity.enableLongPress();
    mActivity.setClickedPosition(-1);
    mActivity.setLongClickedPosition(-1);
    for (i = 0; i < count; i++) {
        View child = mListView.getChildAt(i);
        if ((child.getTop() >= mListView.getListPaddingTop()) && (child.getBottom() <= mListView.getHeight() - mListView.getListPaddingBottom())) {
            TouchUtils.longClickView(this, child);
            assertEquals("Incorrect view position reported being long clicked", i, mActivity.getLongClickedPosition());
            assertEquals("View falsely reported being clicked", -1, mActivity.getClickedPosition());
        }
    }
}
Also used : View(android.view.View) ListView(android.widget.ListView) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Example 49 with LargeTest

use of android.test.suitebuilder.annotation.LargeTest in project android_frameworks_base by ParanoidAndroid.

the class EffectsVideoCapture method testBackEffectsVideoCapture.

@LargeTest
public void testBackEffectsVideoCapture() throws Exception {
    Instrumentation inst = getInstrumentation();
    Intent intent = new Intent();
    intent.setClass(getInstrumentation().getTargetContext(), CameraEffectsRecordingSample.class);
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    intent.putExtra("OUTPUT_FILENAME", Environment.getExternalStorageDirectory().toString() + "/CameraEffectsRecordingTest.mp4");
    Activity act = inst.startActivitySync(intent);
    captureVideos("Back Camera Video Capture\n", inst);
    act.finish();
    // Verification
    File file = new File(Environment.getExternalStorageDirectory(), "CameraEffectsRecordingTest.mp4");
    Uri uri = Uri.fromFile(file);
    verify(getActivity(), uri);
}
Also used : Instrumentation(android.app.Instrumentation) Activity(android.app.Activity) Intent(android.content.Intent) File(java.io.File) Uri(android.net.Uri) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Example 50 with LargeTest

use of android.test.suitebuilder.annotation.LargeTest in project android_frameworks_base by ParanoidAndroid.

the class MediaAudioEffectTest method test3_5SetParameterIntArrayShortArray.

//Test case 3.5: test setParameter(int[], short[])
@LargeTest
public void test3_5SetParameterIntArrayShortArray() throws Exception {
    boolean result = false;
    String msg = "test3_5SetParameterIntArrayShortArray()";
    AudioEffect effect = null;
    try {
        effect = new AudioEffect(AudioEffect.EFFECT_TYPE_EQUALIZER, AudioEffect.EFFECT_TYPE_NULL, 0, 0);
        assertNotNull(msg + ": could not create AudioEffect", effect);
        int[] param = new int[1];
        short[] value = new short[1];
        param[0] = Equalizer.PARAM_CURRENT_PRESET;
        value[0] = (short) 0;
        if (effect.setParameter(param, value) == AudioEffect.SUCCESS) {
            result = true;
        }
    } catch (IllegalArgumentException e) {
        msg = msg.concat(": Bad parameter value");
        loge(msg, "Bad parameter value");
    } catch (UnsupportedOperationException e) {
        msg = msg.concat(": setParameter() rejected");
        loge(msg, "setParameter() rejected");
    } catch (IllegalStateException e) {
        msg = msg.concat("setParameter() called in wrong state");
        loge(msg, "setParameter() called in wrong state");
    } finally {
        if (effect != null) {
            effect.release();
        }
    }
    assertTrue(msg, result);
}
Also used : AudioEffect(android.media.audiofx.AudioEffect) 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