Search in sources :

Example 66 with MediumTest

use of android.test.suitebuilder.annotation.MediumTest in project platform_frameworks_base by android.

the class AccessibilityManagerTest method testSendAccessibilityEvent_AccessibilityEnabled.

@MediumTest
public void testSendAccessibilityEvent_AccessibilityEnabled() throws Exception {
    AccessibilityEvent sentEvent = AccessibilityEvent.obtain();
    when(mMockService.sendAccessibilityEvent(eq(sentEvent), anyInt())).thenReturn(true).thenReturn(false);
    AccessibilityManager manager = createManager(true);
    manager.sendAccessibilityEvent(sentEvent);
    assertSame("The event should be recycled.", sentEvent, AccessibilityEvent.obtain());
    manager.sendAccessibilityEvent(sentEvent);
    assertNotSame("The event should not be recycled.", sentEvent, AccessibilityEvent.obtain());
}
Also used : AccessibilityManager(android.view.accessibility.AccessibilityManager) IAccessibilityManager(android.view.accessibility.IAccessibilityManager) AccessibilityEvent(android.view.accessibility.AccessibilityEvent) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 67 with MediumTest

use of android.test.suitebuilder.annotation.MediumTest in project facebook-android-sdk by facebook.

the class FacebookActivityTests method testLaunchingWithValidNativeLinkingNoUserIntent.

@MediumTest
public void testLaunchingWithValidNativeLinkingNoUserIntent() throws Exception {
    final TestBlocker blocker = getTestBlocker();
    Runnable runnable = new Runnable() {

        public void run() {
            try {
                TestUserManager manager = new TestUserManager(getApplicationSecret(), getApplicationId());
                AccessToken token = manager.getAccessTokenForSharedUser(null);
                Intent intent = new Intent(Intent.ACTION_MAIN);
                intent.putExtras(getNativeLinkingExtras(token.getToken(), null));
                setActivityIntent(intent);
                FacebookTestActivity activity = getActivity();
                AccessToken.createFromNativeLinkingIntent(activity.getIntent(), getApplicationId(), new AccessToken.AccessTokenCreationCallback() {

                    @Override
                    public void onSuccess(AccessToken token) {
                        assertNotNull(token);
                        blocker.signal();
                    }

                    @Override
                    public void onError(FacebookException error) {
                        fail();
                        blocker.signal();
                    }
                });
            } catch (Exception e) {
                // Get back to the test case if there was an uncaught exception
                fail(e.getMessage());
                blocker.signal();
            }
        }
    };
    RunTestWithBlocker(blocker, runnable);
}
Also used : Intent(android.content.Intent) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 68 with MediumTest

use of android.test.suitebuilder.annotation.MediumTest in project facebook-android-sdk by facebook.

the class AsyncRequestTests method testExecuteSingleGet.

@MediumTest
@LargeTest
public void testExecuteSingleGet() {
    final AccessToken accessToken = getAccessTokenForSharedUser();
    Bundle parameters = new Bundle();
    parameters.putString("fields", "location");
    GraphRequest request = new GraphRequest(accessToken, RequestTests.TEST_PAGE_ID, parameters, null, new ExpectSuccessCallback() {

        @Override
        protected void performAsserts(GraphResponse response) {
            assertNotNull(response);
            JSONObject graphPlace = response.getJSONObject();
            assertEquals("Seattle", graphPlace.optJSONObject("location").optString("city"));
        }
    });
    TestGraphRequestAsyncTask task = new TestGraphRequestAsyncTask(request);
    task.executeOnBlockerThread();
    // Wait on 2 signals: request and task will both signal.
    waitAndAssertSuccess(2);
}
Also used : JSONObject(org.json.JSONObject) Bundle(android.os.Bundle) MediumTest(android.test.suitebuilder.annotation.MediumTest) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Example 69 with MediumTest

use of android.test.suitebuilder.annotation.MediumTest in project standup-timer by jwood.

the class MeetingTest method test_delete_a_meeting.

@MediumTest
public void test_delete_a_meeting() {
    Team team = new Team("Test Team");
    Meeting meeting = new Meeting(team, new GregorianCalendar(2010, 1, 5, 10, 15, 0).getTime(), 5, 240, 300, 30, 120);
    meeting = meeting.save(mContext);
    assertEquals(1, Meeting.findAllByTeam(team, mContext).size());
    meeting.delete(mContext);
    assertEquals(0, Meeting.findAllByTeam(team, mContext).size());
}
Also used : Meeting(net.johnpwood.android.standuptimer.model.Meeting) GregorianCalendar(java.util.GregorianCalendar) Team(net.johnpwood.android.standuptimer.model.Team) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 70 with MediumTest

use of android.test.suitebuilder.annotation.MediumTest in project standup-timer by jwood.

the class TeamTest method test_deleting_a_team_deletes_its_meetings_as_well.

@MediumTest
public void test_deleting_a_team_deletes_its_meetings_as_well() {
    Team team = Team.create("Test Team", mContext);
    new Meeting(team, new GregorianCalendar(2010, 1, 5, 10, 15, 0).getTime(), 5, 240, 300, 30, 120).save(mContext);
    new Meeting(team, new GregorianCalendar(2010, 1, 4, 10, 15, 0).getTime(), 5, 240, 300, 30, 120).save(mContext);
    ;
    assertFalse(Meeting.findAllByTeam(team, mContext).isEmpty());
    team.delete(mContext);
    assertEquals(0, Team.findAllTeamNames(mContext).size());
    assertTrue(Meeting.findAllByTeam(team, mContext).isEmpty());
}
Also used : Meeting(net.johnpwood.android.standuptimer.model.Meeting) GregorianCalendar(java.util.GregorianCalendar) Team(net.johnpwood.android.standuptimer.model.Team) 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