Merge "Fix cancel button on screen recording dialog when PSS enabled" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
c2f1f42103
@@ -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