summaryrefslogtreecommitdiff
path: root/tests/hostside
diff options
context:
space:
mode:
author Elliot Sisteron <elliotsisteron@google.com> 2023-07-27 17:00:23 +0000
committer Elliot Sisteron <elliotsisteron@google.com> 2023-07-28 11:17:03 +0000
commit634854be9b320c589a35b1d517227cd39cccc29e (patch)
treeedde37457c18a010daeb442aa8d473a2376c6c60 /tests/hostside
parent75aed2a34e77a1e3db24a93e14ee4ffe325ee94c (diff)
Cleanup safety_center_show_error_entries_on_timeout flag.
This one is a bit trickier because tests rely on this in multiple ways: - UI tests want to ensure that the data on the screen doesn't change, however a refresh is triggered on page open and most tests set the data manually rather than using the receiver to do so. The timeout could set error on UI entries in the middle of the test, which isn't ideal. Worked around this by setting the refresh timeout to the test timeout. - Some existing tests were actively checking the behavior of that flag and using the error listener as an easy way to check for timeouts. I think it's a good thing to cleanup this flag regardless, as we ideally want to have tests matching the production behavior, which wasn't the case here (the flag was set to false in tests, but true in production code). Bug: 289788052 Test: SafetyCenter tests Relnote: N/A Change-Id: I1f9dc8749d46f437c8dfbb98228ed1f042ee5821
Diffstat (limited to 'tests/hostside')
-rw-r--r--tests/hostside/safetycenter/helper-app/src/android/safetycenter/hostside/device/SafetySourceStateCollectedLoggingHelperTests.kt11
1 files changed, 1 insertions, 10 deletions
diff --git a/tests/hostside/safetycenter/helper-app/src/android/safetycenter/hostside/device/SafetySourceStateCollectedLoggingHelperTests.kt b/tests/hostside/safetycenter/helper-app/src/android/safetycenter/hostside/device/SafetySourceStateCollectedLoggingHelperTests.kt
index 9e3a33018..d020aac0a 100644
--- a/tests/hostside/safetycenter/helper-app/src/android/safetycenter/hostside/device/SafetySourceStateCollectedLoggingHelperTests.kt
+++ b/tests/hostside/safetycenter/helper-app/src/android/safetycenter/hostside/device/SafetySourceStateCollectedLoggingHelperTests.kt
@@ -18,9 +18,6 @@ package android.safetycenter.hostside.device
import android.content.Context
import android.safetycenter.SafetyCenterManager
-import android.safetycenter.SafetyCenterStatus
-import android.safetycenter.SafetyCenterStatus.REFRESH_STATUS_DATA_FETCH_IN_PROGRESS
-import android.safetycenter.SafetyCenterStatus.REFRESH_STATUS_FULL_RESCAN_IN_PROGRESS
import android.safetycenter.SafetyEvent
import android.safetycenter.SafetySourceErrorDetails
import androidx.test.core.app.ApplicationProvider
@@ -168,12 +165,6 @@ class SafetySourceStateCollectedLoggingHelperTests {
// things are logged.
val listener = safetyCenterTestHelper.addListener()
safetyCenterManager.refreshSafetySourcesWithReceiverPermissionAndWait(refreshReason)
- listener.receiveSafetyCenterData {
- it.status.refreshStatus == REFRESH_STATUS_DATA_FETCH_IN_PROGRESS ||
- it.status.refreshStatus == REFRESH_STATUS_FULL_RESCAN_IN_PROGRESS
- }
- listener.receiveSafetyCenterData {
- it.status.refreshStatus == SafetyCenterStatus.REFRESH_STATUS_NONE
- }
+ listener.waitForSafetyCenterRefresh()
}
}