TestLiveKitComponent.kt
1012 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package io.livekit.android.mock.dagger
import android.content.Context
import dagger.BindsInstance
import dagger.Component
import io.livekit.android.dagger.JsonFormatModule
import io.livekit.android.dagger.LiveKitComponent
import io.livekit.android.dagger.MemoryModule
import io.livekit.android.mock.MockWebSocketFactory
import io.livekit.android.room.RTCEngine
import javax.inject.Singleton
@Singleton
@Component(
modules = [
TestCoroutinesModule::class,
TestRTCModule::class,
TestWebModule::class,
TestAudioHandlerModule::class,
JsonFormatModule::class,
MemoryModule::class,
]
)
internal interface TestLiveKitComponent : LiveKitComponent {
fun websocketFactory(): MockWebSocketFactory
fun rtcEngine(): RTCEngine
@Component.Factory
interface Factory {
fun create(
@BindsInstance appContext: Context,
coroutinesModule: TestCoroutinesModule = TestCoroutinesModule()
): TestLiveKitComponent
}
}