ScrubbingModeContractTest


@UnstableApi
abstract class ScrubbingModeContractTest


A collection of contract tests for Player implementations that support COMMAND_SET_AUDIO_ATTRIBUTES and scrubbing mode.

Subclasses should only include the logic necessary to construct the Player and provide access to relevant methods and internals by overriding createPlayerInfo.

Subclasses shouldn't include any new @Test methods - implementation-specific tests should be in a separate class.

Summary

Nested types

Interface that allows access to a Player instance, relevant internals, and other methods not implemented within the Player interface required for testing.

Public constructors

Protected functions

abstract ScrubbingModeContractTest.PlayerInfo!

Creates and returns the PlayerInfo with which to run the tests.

Public constructors

ScrubbingModeContractTest

ScrubbingModeContractTest()

Public functions

audioFocusLoss_whileScrubbing_setsPlayWhenReadyToFalse

@Test
fun audioFocusLoss_whileScrubbing_setsPlayWhenReadyToFalse(): Unit

disableScrubbing_afterLossOfAudioFocusWhileScrubbing_handlesDeniedFocusRequest

@Test
fun disableScrubbing_afterLossOfAudioFocusWhileScrubbing_handlesDeniedFocusRequest(

): Unit

disableScrubbing_afterTransientAudioFocusLoss_handlesDeniedFocusRequest

@Test
fun disableScrubbing_afterTransientAudioFocusLoss_handlesDeniedFocusRequest(

): Unit

disableScrubbing_afterTransientAudioFocusLoss_requestsAudioFocus

@Test
fun disableScrubbing_afterTransientAudioFocusLoss_requestsAudioFocus(): Unit

disableScrubbing_audioFocusLostWhileScrubbingWhenPreviouslyPlaying_playsWithGrantedAudioFocus

@Test
fun disableScrubbing_audioFocusLostWhileScrubbingWhenPreviouslyPlaying_playsWithGrantedAudioFocus(

): Unit

disableScrubbing_whilePaused_updatesSuppressionReasonAndDoesNotPlay

@Test
fun disableScrubbing_whilePaused_updatesSuppressionReasonAndDoesNotPlay(): Unit

disableScrubbing_whilePlaying_updatesPlaybackSuppressionReason

@Test
fun disableScrubbing_whilePlaying_updatesPlaybackSuppressionReason(): Unit

enableScrubbingMode_updatesPlaybackSuppressionReason

@Test
fun enableScrubbingMode_updatesPlaybackSuppressionReason(): Unit

recoverAudioFocus_afterTransientLossWhileScrubbing_returnsToScrubbingSuppression

@Test
fun recoverAudioFocus_afterTransientLossWhileScrubbing_returnsToScrubbingSuppression(

): Unit

tearDown

@After
fun tearDown(): Unit

transientAudioFocusLoss_whileScrubbing_onlyUpdatesSuppressionReason

@Test
fun transientAudioFocusLoss_whileScrubbing_onlyUpdatesSuppressionReason(): Unit

Protected functions

createPlayerInfo

@ForOverride
protected abstract fun createPlayerInfo(): ScrubbingModeContractTest.PlayerInfo!

Creates and returns the PlayerInfo with which to run the tests.

The player must have audio focus handling and scrubbing mode initially disabled.