Fix cancel button on screen recording dialog when PSS enabled
Clicking the cancel button was doing nothing, as the cancel click listener was not implemented. Test: ScreenRecordPermissionDialogTest.kt Test: Manually Fixes: 284439734 Change-Id: I1f740f87d080645b9fd34256e9abf5b3765dcde5
This commit is contained in:
@@ -93,6 +93,7 @@ class ScreenRecordPermissionDialog(
|
||||
}
|
||||
dismiss()
|
||||
}
|
||||
setCancelButtonOnClickListener { dismiss() }
|
||||
initRecordOptionsView()
|
||||
}
|
||||
|
||||
|
||||
@@ -104,6 +104,26 @@ class ScreenRecordPermissionDialogTest : SysuiTestCase() {
|
||||
assertThat(visibility).isEqualTo(View.VISIBLE)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun showDialog_dialogIsShowing() {
|
||||
dialog.show()
|
||||
|
||||
assertThat(dialog.isShowing).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun showDialog_cancelClicked_dialogIsDismissed() {
|
||||
dialog.show()
|
||||
|
||||
clickOnCancel()
|
||||
|
||||
assertThat(dialog.isShowing).isFalse()
|
||||
}
|
||||
|
||||
private fun clickOnCancel() {
|
||||
dialog.requireViewById<View>(android.R.id.button2).performClick()
|
||||
}
|
||||
|
||||
private fun onSpinnerItemSelected(position: Int) {
|
||||
val spinner = dialog.requireViewById<Spinner>(R.id.screen_share_mode_spinner)
|
||||
spinner.onItemSelectedListener.onItemSelected(spinner, mock(), position, /* id= */ 0)
|
||||
|
||||
Reference in New Issue
Block a user