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