summaryrefslogtreecommitdiff
path: root/tests/hostside
diff options
context:
space:
mode:
author Yuri Ufimtsev <yufimtsev@google.com> 2024-03-19 16:39:57 +0000
committer Yuri Ufimtsev <yufimtsev@google.com> 2024-03-28 16:18:22 +0000
commit66e78ba57faf5456aa3d017c94e80668477cc0ef (patch)
treed37ec87927b9b3b83e5414e8f02ca363257c14fd /tests/hostside
parentb0bda0f75ef83777c52565a202b7df9bea9661f7 (diff)
Make notification tests of Safety Center wait for specific notifications
Includes ag/26621194 Bug: 327978990 Test: atest SafetyCenterNotificationTest Relnote: fix Safety Center MTS test Change-Id: I080a5653bf6a8146e80f204a4ef184fcc024e48d LOW_COVERAGE_REASON=Fixing tests, no change in logic
Diffstat (limited to 'tests/hostside')
-rw-r--r--tests/hostside/safetycenter/helper-app/src/android/safetycenter/hostside/device/SafetyCenterNotificationLoggingHelperTests.kt10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/hostside/safetycenter/helper-app/src/android/safetycenter/hostside/device/SafetyCenterNotificationLoggingHelperTests.kt b/tests/hostside/safetycenter/helper-app/src/android/safetycenter/hostside/device/SafetyCenterNotificationLoggingHelperTests.kt
index dc3cb3fc2..60e6e41ec 100644
--- a/tests/hostside/safetycenter/helper-app/src/android/safetycenter/hostside/device/SafetyCenterNotificationLoggingHelperTests.kt
+++ b/tests/hostside/safetycenter/helper-app/src/android/safetycenter/hostside/device/SafetyCenterNotificationLoggingHelperTests.kt
@@ -22,6 +22,7 @@ import android.safetycenter.SafetySourceIssue
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.android.safetycenter.pendingintents.PendingIntentSender
+import com.android.safetycenter.testing.NotificationCharacteristics
import com.android.safetycenter.testing.SafetyCenterActivityLauncher
import com.android.safetycenter.testing.SafetyCenterFlags
import com.android.safetycenter.testing.SafetyCenterTestConfigs
@@ -74,7 +75,14 @@ class SafetyCenterNotificationLoggingHelperTests {
fun openSafetyCenterFromNotification() {
safetyCenterTestHelper.setData(SINGLE_SOURCE_ID, newTestDataWithNotifiableIssue())
- sendContentPendingIntent(TestNotificationListener.waitForSingleNotification())
+ sendContentPendingIntent(
+ TestNotificationListener.waitForSingleNotificationMatching(
+ NotificationCharacteristics(
+ actions = listOf("See issue"),
+ safetySourceId = SINGLE_SOURCE_ID,
+ )
+ )
+ )
}
private fun newTestDataWithNotifiableIssue(): SafetySourceData =