mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +00:00
Refactor of voice message playing code (#1643)
After PR review suggestions from @jonnyandrew User facing functionality doesn't change, but overall architecture and testing is better.
This commit is contained in:
+2
-1
@@ -24,6 +24,7 @@ import io.element.android.tests.testutils.simulateLongTask
|
||||
class FakeMediaLoader : MatrixMediaLoader {
|
||||
|
||||
var shouldFail = false
|
||||
var path: String = ""
|
||||
|
||||
override suspend fun loadMediaContent(source: MediaSource): Result<ByteArray> = simulateLongTask {
|
||||
if (shouldFail) {
|
||||
@@ -45,7 +46,7 @@ class FakeMediaLoader : MatrixMediaLoader {
|
||||
if (shouldFail) {
|
||||
Result.failure(RuntimeException())
|
||||
} else {
|
||||
Result.success(FakeMediaFile(""))
|
||||
Result.success(FakeMediaFile(path))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user