use of android.app.Instrumentation.ActivityResult in project Resurrection_packages_apps_Settings by ResurrectionRemix.
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));
PartnerCustomizationLayout layout = mActivityRule.getActivity().findViewById(R.id.setup_wizard_layout);
layout.getMixin(FooterBarMixin.class).getPrimaryButtonView().performClick();
intended(hasComponent(enrollingComponent));
assertTrue(mActivityRule.getActivity().isFinishing());
}
use of android.app.Instrumentation.ActivityResult in project Resurrection_packages_apps_Settings by ResurrectionRemix.
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));
PartnerCustomizationLayout layout = mActivityRule.getActivity().findViewById(R.id.setup_wizard_layout);
layout.getMixin(FooterBarMixin.class).getPrimaryButtonView().performClick();
intended(hasComponent(enrollingComponent));
assertFalse(mActivityRule.getActivity().isFinishing());
}
use of android.app.Instrumentation.ActivityResult in project GT by Tencent.
the class ActivityHookList method execStartActivity.
/**
* Activity 的开始+生命周期: *
*/
@HookAnnotation(className = "android.app.Instrumentation", methodName = "execStartActivity", methodSig = "(Landroid/content/Context;" + "Landroid/os/IBinder;" + "Landroid/os/IBinder;" + "Landroid/app/Activity;" + "Landroid/content/Intent;" + "ILandroid/os/Bundle;)" + "Landroid/app/Instrumentation$ActivityResult;")
public static ActivityResult execStartActivity(Object thiz, Context who, IBinder contextThread, IBinder token, Activity target, Intent intent, int requestCode, Bundle options) {
GTRLog.e(TAG, "Instrumentation.execStartActivity");
long start = System.currentTimeMillis();
Instrumentation.ActivityResult activityResult = execStartActivity_backup(thiz, who, contextThread, token, target, intent, requestCode, options);
long end = System.currentTimeMillis();
GTRClient.pushData(new StringBuilder().append("Instrumentation.execStartActivity").append(GTConfig.separator).append(start).append(GTConfig.separator).append(end).toString());
return activityResult;
}
use of android.app.Instrumentation.ActivityResult in project collect by opendatakit.
the class AllWidgetsFormTest method testExStringWidget.
public void testExStringWidget() {
// Manually input the value:
String exStringWidgetFirstText = randomString();
when(activityAvailability.isActivityAvailable(any(Intent.class))).thenReturn(false);
onView(withText("Launch")).perform(click());
onVisibleEditText().perform(replaceText(exStringWidgetFirstText));
openWidgetList();
onView(withText("Ex string widget")).perform(click());
Screengrab.screenshot("ex-string");
onVisibleEditText().check(matches(withText(exStringWidgetFirstText)));
// Replace with Intent value:
String exStringWidgetSecondText = randomString();
Intent stringIntent = new Intent();
stringIntent.putExtra("value", exStringWidgetSecondText);
ActivityResult exStringResult = new ActivityResult(RESULT_OK, stringIntent);
intending(allOf(hasAction("change.uw.android.BREATHCOUNT"), hasExtra("value", exStringWidgetFirstText))).respondWith(exStringResult);
when(activityAvailability.isActivityAvailable(any(Intent.class))).thenReturn(true);
onView(withText("Launch")).perform(click());
onView(withText(exStringWidgetSecondText)).check(matches(isDisplayed()));
Screengrab.screenshot("ex-string2");
openWidgetList();
onView(withText("Ex string widget")).perform(click());
onVisibleEditText().check(matches(withText(exStringWidgetSecondText)));
onView(withText("Ex string widget")).perform(swipeLeft());
}
use of android.app.Instrumentation.ActivityResult in project android_packages_apps_Settings by omnirom.
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());
}
Aggregations