Search in sources :

Example 21 with AppTask

use of android.app.ActivityManager.AppTask in project robolectric by robolectric.

the class ShadowAppTaskTest method setExcludeFromRecents_excludesFromRecents.

@Test
public void setExcludeFromRecents_excludesFromRecents() {
    final AppTask appTask = ShadowAppTask.newInstance();
    appTask.setExcludeFromRecents(true);
    assertThat(shadowOf(appTask).isExcludedFromRecents()).isTrue();
}
Also used : AppTask(android.app.ActivityManager.AppTask) Test(org.junit.Test)

Example 22 with AppTask

use of android.app.ActivityManager.AppTask in project robolectric by robolectric.

the class ShadowActivityManagerTest method getAppTasks_shouldReturnAppTaskList.

@Test
@Config(minSdk = LOLLIPOP)
public void getAppTasks_shouldReturnAppTaskList() {
    final AppTask task1 = ShadowAppTask.newInstance();
    final AppTask task2 = ShadowAppTask.newInstance();
    assertThat(activityManager.getAppTasks()).isEmpty();
    shadowActivityManager.setAppTasks(Lists.newArrayList(task1, task2));
    assertThat(activityManager.getAppTasks()).containsExactly(task1, task2);
}
Also used : AppTask(android.app.ActivityManager.AppTask) Test(org.junit.Test) Config(org.robolectric.annotation.Config)

Aggregations

AppTask (android.app.ActivityManager.AppTask)22 ActivityManager (android.app.ActivityManager)11 Intent (android.content.Intent)7 Test (org.junit.Test)6 Uri (android.net.Uri)5 Nullable (android.support.annotation.Nullable)5 TargetApi (android.annotation.TargetApi)3 RecentTaskInfo (android.app.ActivityManager.RecentTaskInfo)2 Context (android.content.Context)2 Activity (android.app.Activity)1 PackageManager (android.content.pm.PackageManager)1 HashSet (java.util.HashSet)1 Config (org.robolectric.annotation.Config)1