Loading packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/saver/domain/DataSaverDialogDelegateTest.kt +4 −5 Original line number Diff line number Diff line Loading @@ -33,7 +33,6 @@ import kotlin.coroutines.EmptyCoroutineContext import org.junit.Before import org.junit.Test import org.junit.runner.RunWith import org.mockito.Mockito.mock import org.mockito.Mockito.verify /** Test [DataSaverDialogDelegate]. */ Loading Loading @@ -69,7 +68,7 @@ class DataSaverDialogDelegateTest : SysuiTestCase() { fun delegateSetsDialogTitleCorrectly() { val expectedResId = R.string.data_saver_enable_title dataSaverDialogDelegate.onCreate(sysuiDialog, null) dataSaverDialogDelegate.beforeCreate(sysuiDialog, null) verify(sysuiDialog).setTitle(eq(expectedResId)) } Loading @@ -78,7 +77,7 @@ class DataSaverDialogDelegateTest : SysuiTestCase() { fun delegateSetsDialogMessageCorrectly() { val expectedResId = R.string.data_saver_description dataSaverDialogDelegate.onCreate(sysuiDialog, null) dataSaverDialogDelegate.beforeCreate(sysuiDialog, null) verify(sysuiDialog).setMessage(expectedResId) } Loading @@ -87,7 +86,7 @@ class DataSaverDialogDelegateTest : SysuiTestCase() { fun delegateSetsDialogPositiveButtonCorrectly() { val expectedResId = R.string.data_saver_enable_button dataSaverDialogDelegate.onCreate(sysuiDialog, null) dataSaverDialogDelegate.beforeCreate(sysuiDialog, null) verify(sysuiDialog).setPositiveButton(eq(expectedResId), any()) } Loading @@ -96,7 +95,7 @@ class DataSaverDialogDelegateTest : SysuiTestCase() { fun delegateSetsDialogCancelButtonCorrectly() { val expectedResId = R.string.cancel dataSaverDialogDelegate.onCreate(sysuiDialog, null) dataSaverDialogDelegate.beforeCreate(sysuiDialog, null) verify(sysuiDialog).setNeutralButton(eq(expectedResId), eq(null)) } Loading packages/SystemUI/src/com/android/systemui/qs/tiles/impl/saver/domain/DataSaverDialogDelegate.kt +1 −1 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ class DataSaverDialogDelegate( return sysuiDialogFactory.create(this, context) } override fun onCreate(dialog: SystemUIDialog, savedInstanceState: Bundle?) { override fun beforeCreate(dialog: SystemUIDialog, savedInstanceState: Bundle?) { with(dialog) { setTitle(R.string.data_saver_enable_title) setMessage(R.string.data_saver_description) Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/saver/domain/DataSaverDialogDelegateTest.kt +4 −5 Original line number Diff line number Diff line Loading @@ -33,7 +33,6 @@ import kotlin.coroutines.EmptyCoroutineContext import org.junit.Before import org.junit.Test import org.junit.runner.RunWith import org.mockito.Mockito.mock import org.mockito.Mockito.verify /** Test [DataSaverDialogDelegate]. */ Loading Loading @@ -69,7 +68,7 @@ class DataSaverDialogDelegateTest : SysuiTestCase() { fun delegateSetsDialogTitleCorrectly() { val expectedResId = R.string.data_saver_enable_title dataSaverDialogDelegate.onCreate(sysuiDialog, null) dataSaverDialogDelegate.beforeCreate(sysuiDialog, null) verify(sysuiDialog).setTitle(eq(expectedResId)) } Loading @@ -78,7 +77,7 @@ class DataSaverDialogDelegateTest : SysuiTestCase() { fun delegateSetsDialogMessageCorrectly() { val expectedResId = R.string.data_saver_description dataSaverDialogDelegate.onCreate(sysuiDialog, null) dataSaverDialogDelegate.beforeCreate(sysuiDialog, null) verify(sysuiDialog).setMessage(expectedResId) } Loading @@ -87,7 +86,7 @@ class DataSaverDialogDelegateTest : SysuiTestCase() { fun delegateSetsDialogPositiveButtonCorrectly() { val expectedResId = R.string.data_saver_enable_button dataSaverDialogDelegate.onCreate(sysuiDialog, null) dataSaverDialogDelegate.beforeCreate(sysuiDialog, null) verify(sysuiDialog).setPositiveButton(eq(expectedResId), any()) } Loading @@ -96,7 +95,7 @@ class DataSaverDialogDelegateTest : SysuiTestCase() { fun delegateSetsDialogCancelButtonCorrectly() { val expectedResId = R.string.cancel dataSaverDialogDelegate.onCreate(sysuiDialog, null) dataSaverDialogDelegate.beforeCreate(sysuiDialog, null) verify(sysuiDialog).setNeutralButton(eq(expectedResId), eq(null)) } Loading
packages/SystemUI/src/com/android/systemui/qs/tiles/impl/saver/domain/DataSaverDialogDelegate.kt +1 −1 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ class DataSaverDialogDelegate( return sysuiDialogFactory.create(this, context) } override fun onCreate(dialog: SystemUIDialog, savedInstanceState: Bundle?) { override fun beforeCreate(dialog: SystemUIDialog, savedInstanceState: Bundle?) { with(dialog) { setTitle(R.string.data_saver_enable_title) setMessage(R.string.data_saver_description) Loading