use of android.test.suitebuilder.annotation.MediumTest in project platform_frameworks_base by android.
the class ListWithScreenOfNoSelectablesTest method testGoFromNoSelectionToSelectionExists.
@MediumTest
// Failing.
@Suppress
public void testGoFromNoSelectionToSelectionExists() {
// go down untile first (and only selectable) item is off screen
View first = mListView.getChildAt(0);
while (first.getParent() != null) {
sendKeys(KeyEvent.KEYCODE_DPAD_DOWN);
}
// nothing should be selected
assertEquals("selected position", ListView.INVALID_POSITION, mListView.getSelectedItemPosition());
assertNull("selected view", mListView.getSelectedView());
// go up once to bring the selectable back on screen
sendKeys(KeyEvent.KEYCODE_DPAD_UP);
assertEquals("first visible position", 0, mListView.getFirstVisiblePosition());
assertEquals("selected position", ListView.INVALID_POSITION, mListView.getSelectedItemPosition());
// up once more should give it selection
sendKeys(KeyEvent.KEYCODE_DPAD_UP);
assertEquals("selected position", 0, mListView.getSelectedItemPosition());
}
use of android.test.suitebuilder.annotation.MediumTest in project platform_frameworks_base by android.
the class MediaPlayerInvokeTest method testPing.
// Generate a random number, sends it to the ping test player.
@Suppress
@MediumTest
public void testPing() throws Exception {
mPlayer.setDataSource("test:invoke_mock_media_player.so?url=ping");
Parcel request = mPlayer.newRequest();
Parcel reply = Parcel.obtain();
int val = rnd.nextInt();
request.writeInt(val);
mPlayer.invoke(request, reply);
assertEquals(val, reply.readInt());
}
use of android.test.suitebuilder.annotation.MediumTest in project platform_frameworks_base by android.
the class AppCacheTest method testAppFilesCreateFile.
/*
* This test case verifies that output written to a file
* using Context.openFileOutput has executed successfully.
* The operation is verified by invoking Context.openFileInput
*/
@MediumTest
public void testAppFilesCreateFile() {
String fileName = "testFile1.txt";
String fileOut = "abcdefghijklmnopqrstuvwxyz";
Context con = super.getContext();
try {
FileOutputStream fos = con.openFileOutput(fileName, Context.MODE_PRIVATE);
fos.close();
} catch (FileNotFoundException e) {
failStr(e);
} catch (IOException e) {
failStr(e);
}
}
use of android.test.suitebuilder.annotation.MediumTest in project platform_frameworks_base by android.
the class LimitedLengthInputStreamTest method testConstructor_NullInputStream_Failure.
@MediumTest
public void testConstructor_NullInputStream_Failure() throws Exception {
try {
InputStream is = new LimitedLengthInputStream(null, 0, 1);
fail("Should throw IOException on null input stream");
} catch (IOException e) {
// success
}
}
use of android.test.suitebuilder.annotation.MediumTest in project platform_frameworks_base by android.
the class ServiceTest method testLocalUnbindTwice.
@MediumTest
public void testLocalUnbindTwice() throws Exception {
EmptyConnection conn = new EmptyConnection();
getContext().bindService(new Intent(SERVICE_LOCAL_GRANTED), conn, 0);
getContext().unbindService(conn);
try {
getContext().unbindService(conn);
fail("No exception thrown on second unbind");
} catch (IllegalArgumentException e) {
//Log.i("foo", "Unbind exception", e);
}
}
Aggregations