use of com.android.settings.testutils.shadow.ShadowAlertDialogCompat in project packages_apps_Settings by Evolution-X.
the class BatteryTipDialogFragmentTest method testOnCreateDialog_highUsageTip_fireHighUsageDialog.
@Test
public void testOnCreateDialog_highUsageTip_fireHighUsageDialog() {
Robolectric.getForegroundThreadScheduler().pause();
mDialogFragment = BatteryTipDialogFragment.newInstance(mHighUsageTip, METRICS_KEY);
FragmentController.setupFragment(mDialogFragment, FragmentActivity.class, 0, /* containerViewId */
null);
Robolectric.getForegroundThreadScheduler().advanceToLastPostedRunnable();
final AlertDialog dialog = ShadowAlertDialogCompat.getLatestAlertDialog();
ShadowAlertDialogCompat shadowDialog = ShadowAlertDialogCompat.shadowOf(dialog);
assertThat(shadowDialog.getMessage()).isEqualTo(mContext.getString(R.string.battery_tip_dialog_message, 1));
}
use of com.android.settings.testutils.shadow.ShadowAlertDialogCompat in project packages_apps_Settings by Evolution-X.
the class SetupSkipDialogTest method dialogMessage_whenSkipPasswordSetupForFace_shouldShownCorrectly.
@Test
public void dialogMessage_whenSkipPasswordSetupForFace_shouldShownCorrectly() {
SetupSkipDialog setupSkipDialog = SetupSkipDialog.newInstance(true, false, true, false, true, false);
setupSkipDialog.show(mActivity.getSupportFragmentManager());
AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
assertThat(alertDialog).isNotNull();
ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog);
assertThat(shadowAlertDialog.getTitle()).isEqualTo(mActivity.getString(R.string.lock_screen_password_skip_face_title));
assertThat(shadowAlertDialog.getMessage()).isEqualTo(mActivity.getString(R.string.lock_screen_password_skip_face_message));
}
use of com.android.settings.testutils.shadow.ShadowAlertDialogCompat in project packages_apps_Settings by Evolution-X.
the class SetupSkipDialogTest method frpMessages_areShownCorrectly_whenNotSupported.
@Test
public void frpMessages_areShownCorrectly_whenNotSupported() {
SetupSkipDialog setupSkipDialog = SetupSkipDialog.newInstance(false, false, false, false, false, false);
setupSkipDialog.show(mActivity.getSupportFragmentManager());
AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
assertThat(alertDialog).isNotNull();
ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog);
assertThat(mActivity.getString(R.string.lock_screen_intro_skip_title)).isEqualTo(shadowAlertDialog.getTitle());
assertThat(mActivity.getString(R.string.lock_screen_intro_skip_dialog_text)).isEqualTo(shadowAlertDialog.getMessage());
}
use of com.android.settings.testutils.shadow.ShadowAlertDialogCompat in project packages_apps_Settings by Evolution-X.
the class SetupSkipDialogTest method frpMessages_areShownCorrectly_whenSupported.
@Test
public void frpMessages_areShownCorrectly_whenSupported() {
SetupSkipDialog setupSkipDialog = SetupSkipDialog.newInstance(true, false, false, false, false, false);
setupSkipDialog.show(mActivity.getSupportFragmentManager());
AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
assertThat(alertDialog).isNotNull();
ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog);
assertThat(mActivity.getString(R.string.lock_screen_intro_skip_title)).isEqualTo(shadowAlertDialog.getTitle());
assertThat(mActivity.getString(R.string.lock_screen_intro_skip_dialog_text_frp)).isEqualTo(shadowAlertDialog.getMessage());
}
use of com.android.settings.testutils.shadow.ShadowAlertDialogCompat in project packages_apps_Settings by Evolution-X.
the class SetupSkipDialogTest method dialogMessage_whenSkipPinSetupForFingerprint_shouldShownCorrectly.
@Test
public void dialogMessage_whenSkipPinSetupForFingerprint_shouldShownCorrectly() {
SetupSkipDialog setupSkipDialog = SetupSkipDialog.newInstance(true, false, false, true, false, false);
setupSkipDialog.show(mActivity.getSupportFragmentManager());
AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
assertThat(alertDialog).isNotNull();
ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog);
assertThat(shadowAlertDialog.getTitle()).isEqualTo(mActivity.getString(R.string.lock_screen_pin_skip_fingerprint_title));
assertThat(shadowAlertDialog.getMessage()).isEqualTo(mActivity.getString(R.string.lock_screen_pin_skip_fingerprint_message));
}
Aggregations