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);
}
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);
}
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());
}
}
}
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);
}
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);
}
Aggregations