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:
parent
cabd7ac388
commit
40e19349b5
10 changed files with 562 additions and 454 deletions
|
|
@ -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))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue