Search in sources :

Example 1 with ForgetConfirmFragment

use of com.android.settings.deviceinfo.PrivateVolumeForget.ForgetConfirmFragment in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class PrivateVolumeForgetTest method OnClickListener_shouldCallForget.

@Test
public void OnClickListener_shouldCallForget() {
    assertThat(ShadowStorageManager.isForgetCalled()).isFalse();
    final Button confirm = mFragment.getView().findViewById(R.id.confirm);
    confirm.performClick();
    final ForgetConfirmFragment confirmFragment = (ForgetConfirmFragment) mActivity.getSupportFragmentManager().findFragmentByTag(PrivateVolumeForget.TAG_FORGET_CONFIRM);
    assertThat(confirmFragment).isNotNull();
    final AlertDialog dialog = (AlertDialog) confirmFragment.getDialog();
    final Button forget = dialog.getButton(DialogInterface.BUTTON_POSITIVE);
    forget.performClick();
    assertThat(ShadowStorageManager.isForgetCalled()).isTrue();
}
Also used : AlertDialog(androidx.appcompat.app.AlertDialog) Button(android.widget.Button) ForgetConfirmFragment(com.android.settings.deviceinfo.PrivateVolumeForget.ForgetConfirmFragment) Test(org.junit.Test)

Aggregations

Button (android.widget.Button)1 AlertDialog (androidx.appcompat.app.AlertDialog)1 ForgetConfirmFragment (com.android.settings.deviceinfo.PrivateVolumeForget.ForgetConfirmFragment)1 Test (org.junit.Test)1