Documentation ¶
Overview ¶
Package mediasession contains common utilities to help writing ARC media session tests.
Index ¶
- func AbandonAudioFocusInAndroid(ctx context.Context, dev *ui.Device) error
- func RunTest(ctx context.Context, s *testing.State, f TestFunc)
- func SwitchToTestApp(ctx context.Context, a *arc.ARC) error
- func WaitForAndroidAudioFocusChange(ctx context.Context, d *ui.Device, focusType AudioFocusType) error
- func WaitForAndroidAudioFocusGain(ctx context.Context, d *ui.Device, focusType AudioFocusType) error
- type AudioFocusType
- type TestFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbandonAudioFocusInAndroid ¶
AbandonAudioFocusInAndroid tells the test app to abandon audio focus.
func RunTest ¶
RunTest starts Chrome with the media session features enabled. It installs the ARC test app, launches it and waits for it to be ready.
func SwitchToTestApp ¶
SwitchToTestApp switches the focus to the test app.
func WaitForAndroidAudioFocusChange ¶
func WaitForAndroidAudioFocusChange(ctx context.Context, d *ui.Device, focusType AudioFocusType) error
WaitForAndroidAudioFocusChange waits for the test app to display that its audio focus type changed.
func WaitForAndroidAudioFocusGain ¶
func WaitForAndroidAudioFocusGain(ctx context.Context, d *ui.Device, focusType AudioFocusType) error
WaitForAndroidAudioFocusGain waits for the test app to gain a certain audio focus type and display that it is successful.
Types ¶
type AudioFocusType ¶
type AudioFocusType string
AudioFocusType contains the various audio focus types an Android app can have.
const ( // AudioFocusLoss is the audio focus state when focus has been lost. AudioFocusLoss AudioFocusType = "-1" // AudioFocusGain is the audio focus state when the "Gain" audio focus type has been granted. AudioFocusGain AudioFocusType = "1" // AudioFocusGainTransient is the audio focus state when the "Gain Transient" audio focus type has been granted. AudioFocusGainTransient AudioFocusType = "2" // AudioFocusGainTransientMayDuck is the audio focus state when the "Gain Transient May Duck" audio focus type has been granted. AudioFocusGainTransientMayDuck AudioFocusType = "3" )
Click to show internal directories.
Click to hide internal directories.