Search in sources :

Example 6 with Robolectric.setupActivity

use of org.robolectric.Robolectric.setupActivity in project robolectric by robolectric.

the class ShadowActivityTest method shouldSupportIsTaskRoot.

@Test
public void shouldSupportIsTaskRoot() throws Exception {
    Activity activity = Robolectric.setupActivity(Activity.class);
    // as implemented, Activities are considered task roots by default
    assertTrue(activity.isTaskRoot());
    shadowOf(activity).setIsTaskRoot(false);
    assertFalse(activity.isTaskRoot());
}
Also used : Robolectric.setupActivity(org.robolectric.Robolectric.setupActivity) Robolectric.buildActivity(org.robolectric.Robolectric.buildActivity) Activity(android.app.Activity) Test(org.junit.Test)

Aggregations

Activity (android.app.Activity)6 Test (org.junit.Test)6 Robolectric.buildActivity (org.robolectric.Robolectric.buildActivity)6 Robolectric.setupActivity (org.robolectric.Robolectric.setupActivity)6 ComponentName (android.content.ComponentName)1 SharedPreferences (android.content.SharedPreferences)1