mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-13 09:26:52 -04:00
Restricting testExtractDocumentId
and testDocumentProviderContentQuery
test cases on API level 33 since numerous security updates have been included, preventing us from modifying the default behavior of ContentResolver. So running the test case on this APi level leads to test failure.
This commit is contained in:
parent
dbbd02b08b
commit
e1c69aa259
@ -354,6 +354,11 @@ class FileUtilsInstrumentationTest {
|
||||
|
||||
@Test
|
||||
fun testExtractDocumentId() {
|
||||
// We are not running this test case on Android 13 and above. In this version,
|
||||
// numerous security updates have been included, preventing us from modifying the
|
||||
// default behavior of ContentResolver.
|
||||
// Therefore, we are restricting this test to API level 33 and below.
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
||||
val dummyDownloadUriData = arrayOf(
|
||||
DummyUrlData(
|
||||
null,
|
||||
@ -398,9 +403,15 @@ class FileUtilsInstrumentationTest {
|
||||
assertEquals(expectedDocumentId, actualDocumentId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testDocumentProviderContentQuery() {
|
||||
// We are not running this test case on Android 13 and above. In this version,
|
||||
// numerous security updates have been included, preventing us from modifying the
|
||||
// default behavior of ContentResolver.
|
||||
// Therefore, we are restricting this test to API level 33 and below.
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
||||
// test to get the download uri on old device
|
||||
testWithDownloadUri(
|
||||
Uri.parse("${downloadDocumentUriPrefix}raw%3A%2Fstorage%2Femulated%2F0%2F$commonUri"),
|
||||
@ -448,6 +459,7 @@ class FileUtilsInstrumentationTest {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun testWithDownloadUri(
|
||||
uri: Uri,
|
||||
|
Loading…
x
Reference in New Issue
Block a user