Loading packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialog.kt +1 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ class ScreenRecordPermissionDialog( } dismiss() } setCancelButtonOnClickListener { dismiss() } initRecordOptionsView() } Loading packages/SystemUI/tests/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialogTest.kt +20 −0 Original line number Diff line number Diff line Loading @@ -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) Loading Loading
packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialog.kt +1 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ class ScreenRecordPermissionDialog( } dismiss() } setCancelButtonOnClickListener { dismiss() } initRecordOptionsView() } Loading
packages/SystemUI/tests/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialogTest.kt +20 −0 Original line number Diff line number Diff line Loading @@ -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) Loading