ScrubbingModeContractTest


@UnstableApi
public 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 methods

abstract ScrubbingModeContractTest.PlayerInfo

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

Public constructors

ScrubbingModeContractTest

public ScrubbingModeContractTest()

Public methods

audioFocusLoss_whileScrubbing_setsPlayWhenReadyToFalse

@Test
public void audioFocusLoss_whileScrubbing_setsPlayWhenReadyToFalse()

disableScrubbing_afterLossOfAudioFocusWhileScrubbing_handlesDeniedFocusRequest

@Test
public void disableScrubbing_afterLossOfAudioFocusWhileScrubbing_handlesDeniedFocusRequest(

)

disableScrubbing_afterTransientAudioFocusLoss_handlesDeniedFocusRequest

@Test
public void disableScrubbing_afterTransientAudioFocusLoss_handlesDeniedFocusRequest(

)

disableScrubbing_afterTransientAudioFocusLoss_requestsAudioFocus

@Test
public void disableScrubbing_afterTransientAudioFocusLoss_requestsAudioFocus()

disableScrubbing_audioFocusLostWhileScrubbingWhenPreviouslyPlaying_playsWithGrantedAudioFocus

@Test
public void disableScrubbing_audioFocusLostWhileScrubbingWhenPreviouslyPlaying_playsWithGrantedAudioFocus(

)

disableScrubbing_whilePaused_updatesSuppressionReasonAndDoesNotPlay

@Test
public void disableScrubbing_whilePaused_updatesSuppressionReasonAndDoesNotPlay()

disableScrubbing_whilePlaying_updatesPlaybackSuppressionReason

@Test
public void disableScrubbing_whilePlaying_updatesPlaybackSuppressionReason()

enableScrubbingMode_updatesPlaybackSuppressionReason

@Test
public void enableScrubbingMode_updatesPlaybackSuppressionReason()

recoverAudioFocus_afterTransientLossWhileScrubbing_returnsToScrubbingSuppression

@Test
public void recoverAudioFocus_afterTransientLossWhileScrubbing_returnsToScrubbingSuppression(

)

tearDown

@After
public final void tearDown()

transientAudioFocusLoss_whileScrubbing_onlyUpdatesSuppressionReason

@Test
public void transientAudioFocusLoss_whileScrubbing_onlyUpdatesSuppressionReason()

Protected methods

createPlayerInfo

@ForOverride
protected abstract ScrubbingModeContractTest.PlayerInfo createPlayerInfo()

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

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