mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 09:39:25 +03:00
Fix tests
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
parent
b555cb7a81
commit
89770f0de2
2 changed files with 7 additions and 1 deletions
|
@ -5,11 +5,14 @@ import androidx.test.core.app.launchActivity
|
|||
import com.nextcloud.client.jobs.upload.FileUploadWorker
|
||||
import com.nextcloud.test.TestActivity
|
||||
import com.owncloud.android.AbstractIT
|
||||
import com.owncloud.android.lib.common.utils.Log_OC
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
|
||||
class UriUploaderIT : AbstractIT() {
|
||||
|
||||
private val tag = "UriUploaderIT"
|
||||
|
||||
@Test
|
||||
fun testUploadPrivatePathSharedPreferences() {
|
||||
launchActivity<TestActivity>().use { scenario ->
|
||||
|
@ -43,6 +46,9 @@ class UriUploaderIT : AbstractIT() {
|
|||
null
|
||||
)
|
||||
val uploadResult = sut.uploadUris()
|
||||
|
||||
Log_OC.d(tag, "Upload Result: ${uploadResult.name}")
|
||||
|
||||
Assert.assertEquals(
|
||||
"Wrong result code",
|
||||
UriUploader.UriUploaderResultCode.ERROR_SENSITIVE_PATH,
|
||||
|
|
|
@ -115,7 +115,7 @@ class UriUploader(
|
|||
|
||||
private fun belongsToCurrentApplication(ctx: Context, uri: Uri): Boolean {
|
||||
val authority: String = uri.authority.toString()
|
||||
val info: ProviderInfo = ctx.packageManager.resolveContentProvider(authority, 0) ?: return false
|
||||
val info: ProviderInfo = ctx.packageManager.resolveContentProvider(authority, 0) ?: return true
|
||||
return ctx.packageName.equals(info.packageName)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue