Search in sources :

Example 21 with ActivityResult

use of android.app.Instrumentation.ActivityResult in project android_packages_apps_Settings by DirtyUnicorns.

the class FingerprintEnrollFinishTest method clickAddAnother_shouldPropagateResults.

@Test
public void clickAddAnother_shouldPropagateResults() {
    final ComponentName enrollingComponent = new ComponentName(getTargetContext(), FingerprintEnrollEnrolling.class);
    intending(hasComponent(enrollingComponent)).respondWith(new ActivityResult(Activity.RESULT_OK, null));
    onView(withId(R.id.add_another_button)).perform(click());
    intended(hasComponent(enrollingComponent));
    assertTrue(mActivityRule.getActivity().isFinishing());
}
Also used : ComponentName(android.content.ComponentName) ActivityResult(android.app.Instrumentation.ActivityResult) Test(org.junit.Test) SmallTest(android.support.test.filters.SmallTest)

Example 22 with ActivityResult

use of android.app.Instrumentation.ActivityResult in project android_packages_apps_Settings by DirtyUnicorns.

the class FingerprintEnrollFinishTest method clickAddAnother_shouldLaunchEnrolling.

@Test
public void clickAddAnother_shouldLaunchEnrolling() {
    final ComponentName enrollingComponent = new ComponentName(getTargetContext(), FingerprintEnrollEnrolling.class);
    intending(hasComponent(enrollingComponent)).respondWith(new ActivityResult(Activity.RESULT_CANCELED, null));
    onView(withId(R.id.add_another_button)).perform(click());
    intended(hasComponent(enrollingComponent));
    assertFalse(mActivityRule.getActivity().isFinishing());
}
Also used : ComponentName(android.content.ComponentName) ActivityResult(android.app.Instrumentation.ActivityResult) Test(org.junit.Test) SmallTest(android.support.test.filters.SmallTest)

Example 23 with ActivityResult

use of android.app.Instrumentation.ActivityResult in project android_packages_apps_Settings by crdroidandroid.

the class FingerprintEnrollFinishTest method clickAddAnother_shouldLaunchEnrolling.

@Test
public void clickAddAnother_shouldLaunchEnrolling() {
    final ComponentName enrollingComponent = new ComponentName(getTargetContext(), FingerprintEnrollEnrolling.class);
    intending(hasComponent(enrollingComponent)).respondWith(new ActivityResult(Activity.RESULT_CANCELED, null));
    onView(withId(R.id.add_another_button)).perform(click());
    intended(hasComponent(enrollingComponent));
    assertFalse(mActivityRule.getActivity().isFinishing());
}
Also used : ComponentName(android.content.ComponentName) ActivityResult(android.app.Instrumentation.ActivityResult) Test(org.junit.Test) SmallTest(android.support.test.filters.SmallTest)

Example 24 with ActivityResult

use of android.app.Instrumentation.ActivityResult in project android-testing by googlesamples.

the class ImageViewerActivityTest method stubCameraIntent.

@Before
public void stubCameraIntent() {
    // Initializes Intents and begins recording intents.
    Intents.init();
    ActivityResult result = createImageCaptureActivityResultStub();
    // Stub the Intent.
    intending(hasAction(MediaStore.ACTION_IMAGE_CAPTURE)).respondWith(result);
}
Also used : ActivityResult(android.app.Instrumentation.ActivityResult) Before(org.junit.Before)

Example 25 with ActivityResult

use of android.app.Instrumentation.ActivityResult in project platform_packages_apps_Settings by BlissRoms.

the class FingerprintEnrollFinishTest method clickAddAnother_shouldLaunchEnrolling.

@Test
public void clickAddAnother_shouldLaunchEnrolling() {
    final ComponentName enrollingComponent = new ComponentName(getTargetContext(), FingerprintEnrollEnrolling.class);
    intending(hasComponent(enrollingComponent)).respondWith(new ActivityResult(Activity.RESULT_CANCELED, null));
    onView(withId(R.id.add_another_button)).perform(click());
    intended(hasComponent(enrollingComponent));
    assertFalse(mActivityRule.getActivity().isFinishing());
}
Also used : ComponentName(android.content.ComponentName) ActivityResult(android.app.Instrumentation.ActivityResult) Test(org.junit.Test) SmallTest(android.support.test.filters.SmallTest)

Aggregations

ActivityResult (android.app.Instrumentation.ActivityResult)25 Test (org.junit.Test)18 ComponentName (android.content.ComponentName)14 SmallTest (android.support.test.filters.SmallTest)12 Intent (android.content.Intent)6 RandomString (net.bytebuddy.utility.RandomString)3 SmallTest (androidx.test.filters.SmallTest)2 PartnerCustomizationLayout (com.google.android.setupcompat.PartnerCustomizationLayout)2 Instrumentation (android.app.Instrumentation)1 Bundle (android.os.Bundle)1 LargeTest (android.support.test.filters.LargeTest)1 DocumentFile (androidx.documentfile.provider.DocumentFile)1 LargeTest (androidx.test.filters.LargeTest)1 HookAnnotation (com.kunpeng.pit.HookAnnotation)1 OrgzlyTest (com.orgzly.android.OrgzlyTest)1 File (java.io.File)1 Before (org.junit.Before)1 ShadowActivity (org.robolectric.shadows.ShadowActivity)1