FakeMediaControlContext

class FakeMediaControlContext

Provides a fake MediaControlContext, and MutableLiveDatas to adjust its contents for a test.

This can be used for tests of MediaControl classes.

The mediaControlContext almost works like a normal context, but no action will be executed when MediaControlContext.actionLauncher is invoked.

Constructors

Link copied to clipboard
fun FakeMediaControlContext()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val mediaControlContext: MediaControlContext

Test MediaControlContext using the MutableLiveData members of FakeMediaControlContext. Can be passed to systems under test to be able to alter the configuration for MediaControl classes.

Link copied to clipboard
val mutableActions: MutableLiveData<List<Action>>

List of Actions exposed by the test media source.

Link copied to clipboard
val mutableMediaItem: MutableLiveData<IviMediaItem?>

Active IviMediaItem being played by the active mutableSourceId. Defaults to null.

Link copied to clipboard
val mutablePlaybackState: MutableLiveData<IviPlaybackState>
Link copied to clipboard
val mutableSourceId: MutableLiveData<SourceId?>

The active SourceId. May be set to null. Defaults to DEFAULT_SOURCE_ID.