Search in sources :

Example 31 with ShadowAlertDialogCompat

use of com.android.settings.testutils.shadow.ShadowAlertDialogCompat in project android_packages_apps_Settings by AOSPA.

the class SetupSkipDialogTest method dialogMessage_whenSkipPatternSetupForFingerprint_shouldShownCorrectly.

@Test
public void dialogMessage_whenSkipPatternSetupForFingerprint_shouldShownCorrectly() {
    SetupSkipDialog setupSkipDialog = SetupSkipDialog.newInstance(true, true, 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_pattern_skip_fingerprint_title));
    assertThat(shadowAlertDialog.getMessage()).isEqualTo(mActivity.getString(R.string.lock_screen_pattern_skip_fingerprint_message));
}
Also used : AlertDialog(androidx.appcompat.app.AlertDialog) ShadowAlertDialogCompat(com.android.settings.testutils.shadow.ShadowAlertDialogCompat) Test(org.junit.Test)

Example 32 with ShadowAlertDialogCompat

use of com.android.settings.testutils.shadow.ShadowAlertDialogCompat in project android_packages_apps_Settings by AOSPA.

the class SetupSkipDialogTest method dialogMessage_whenSkipPinSetupForFace_shouldShownCorrectly.

@Test
public void dialogMessage_whenSkipPinSetupForFace_shouldShownCorrectly() {
    SetupSkipDialog setupSkipDialog = SetupSkipDialog.newInstance(true, false, false, 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_pin_skip_biometrics_title));
    assertThat(shadowAlertDialog.getMessage()).isEqualTo(mActivity.getString(R.string.lock_screen_pin_skip_biometrics_message));
}
Also used : AlertDialog(androidx.appcompat.app.AlertDialog) ShadowAlertDialogCompat(com.android.settings.testutils.shadow.ShadowAlertDialogCompat) Test(org.junit.Test)

Example 33 with ShadowAlertDialogCompat

use of com.android.settings.testutils.shadow.ShadowAlertDialogCompat in project android_packages_apps_Settings by AOSPA.

the class SetupSkipDialogTest method dialogMessage_whenSkipPasswordSetupForBiometrics_shouldShownCorrectly.

@Test
public void dialogMessage_whenSkipPasswordSetupForBiometrics_shouldShownCorrectly() {
    SetupSkipDialog setupSkipDialog = SetupSkipDialog.newInstance(true, false, true, false, false, true);
    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_biometrics_title));
    assertThat(shadowAlertDialog.getMessage()).isEqualTo(mActivity.getString(R.string.lock_screen_password_skip_biometrics_message));
}
Also used : AlertDialog(androidx.appcompat.app.AlertDialog) ShadowAlertDialogCompat(com.android.settings.testutils.shadow.ShadowAlertDialogCompat) Test(org.junit.Test)

Example 34 with ShadowAlertDialogCompat

use of com.android.settings.testutils.shadow.ShadowAlertDialogCompat in project android_packages_apps_Settings by AOSPA.

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());
}
Also used : AlertDialog(androidx.appcompat.app.AlertDialog) ShadowAlertDialogCompat(com.android.settings.testutils.shadow.ShadowAlertDialogCompat) Test(org.junit.Test)

Example 35 with ShadowAlertDialogCompat

use of com.android.settings.testutils.shadow.ShadowAlertDialogCompat in project android_packages_apps_Settings by AOSPA.

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());
}
Also used : AlertDialog(androidx.appcompat.app.AlertDialog) ShadowAlertDialogCompat(com.android.settings.testutils.shadow.ShadowAlertDialogCompat) Test(org.junit.Test)

Aggregations

AlertDialog (androidx.appcompat.app.AlertDialog)496 ShadowAlertDialogCompat (com.android.settings.testutils.shadow.ShadowAlertDialogCompat)496 Test (org.junit.Test)496 BatteryTipDialogFragment (com.android.settings.fuelgauge.batterytip.BatteryTipDialogFragment)28 Intent (android.content.Intent)14 Bundle (android.os.Bundle)14 RestrictAppTip (com.android.settings.fuelgauge.batterytip.tips.RestrictAppTip)14 OnLockTypeSelectedListener (com.android.settings.password.ChooseLockTypeDialogFragment.OnLockTypeSelectedListener)14 PartnerCustomizationLayout (com.google.android.setupcompat.PartnerCustomizationLayout)14 ArrayList (java.util.ArrayList)14 Config (org.robolectric.annotation.Config)14