Make the foreground-service test read the running API level
The three foreground-service-type regimes (none at 33, dataSync at 34, mediaProcessing at 35+) are the reason ConversionForegroundType exists, so the test derives its expectation from Build.VERSION rather than pinning one value. The same test then means something on any device in the supported range instead of only on the one it was written against. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -52,6 +52,11 @@ class ConversionWorkerTest {
|
||||
File(context.cacheDir, "conversions").listFiles()?.forEach { it.delete() }
|
||||
}
|
||||
|
||||
/**
|
||||
* Deliberately derives the expectation from the running API rather than pinning a
|
||||
* value, so the same test is meaningful on an API 33, 34 or 35+ device. The three
|
||||
* regimes are the whole reason ConversionForegroundType exists.
|
||||
*/
|
||||
@Test
|
||||
fun foregroundTypeMatchesTheRunningApiLevel() {
|
||||
val expected = when {
|
||||
|
||||
Reference in New Issue
Block a user