Search in sources :

Example 46 with MediumTest

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());
}
Also used : View(android.view.View) ListView(android.widget.ListView) Suppress(android.test.suitebuilder.annotation.Suppress) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 47 with MediumTest

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());
}
Also used : Parcel(android.os.Parcel) Suppress(android.test.suitebuilder.annotation.Suppress) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 48 with MediumTest

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);
    }
}
Also used : Context(android.content.Context) FileOutputStream(java.io.FileOutputStream) FileNotFoundException(java.io.FileNotFoundException) IOException(java.io.IOException) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 49 with MediumTest

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
    }
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) IOException(java.io.IOException) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 50 with MediumTest

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);
    }
}
Also used : Intent(android.content.Intent) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Aggregations

MediumTest (android.test.suitebuilder.annotation.MediumTest)996 View (android.view.View)246 ListView (android.widget.ListView)150 Cursor (android.database.Cursor)116 Handler (android.os.Handler)116 Suppress (android.test.suitebuilder.annotation.Suppress)69 TextView (android.widget.TextView)67 ContentValues (android.content.ContentValues)63 ServiceStatus (com.vodafone360.people.service.ServiceStatus)60 SQLiteCursor (android.database.sqlite.SQLiteCursor)54 SQLiteStatement (android.database.sqlite.SQLiteStatement)49 IOException (java.io.IOException)49 UiThreadTest (android.test.UiThreadTest)48 LogRec (com.android.internal.util.StateMachine.LogRec)42 ContentResolver (android.content.ContentResolver)37 Intent (android.content.Intent)36 Message (android.os.Message)36 GridView (android.widget.GridView)36 InputStream (java.io.InputStream)36 ByteArrayInputStream (java.io.ByteArrayInputStream)35