blob: 5939e0c2102c6db837df75b0b46f9f9c77c77969 [file] [log] [blame]
** <audio> element test **
** Check category before anything has loaded.
EXPECTED (internals.audioSessionCategory() == 'None') OK
** Check category when a muted, paused, element has loaded.
EVENT(canplaythrough)
EXPECTED (internals.audioSessionCategory() == 'None') OK
** Check category when a muted element is playing.
RUN(video.play())
EVENT(playing)
EXPECTED (internals.audioSessionCategory() == 'None') OK
** Check category when an unmuted element is playing.
RUN(video.muted = false)
EVENT(volumechange)
EXPECTED (internals.audioSessionCategory() == 'MediaPlayback') OK
** Mute the element, check again after 500ms.
RUN(video.pause())
RUN(video.muted = true)
EXPECTED (internals.audioSessionCategory() == 'MediaPlayback') OK
** And check again after 3 seconds.
EXPECTED (internals.audioSessionCategory() == 'None') OK
** AudioContext test **
** Check category before creating AudioContext.
EXPECTED (internals.audioSessionCategory() == 'None') OK
** Check category after oscillator graph has been connected but not started.
EXPECTED (internals.audioSessionCategory() == 'None') OK
** Check category after starting oscillator.
EXPECTED (internals.audioSessionCategory() == 'AmbientSound') OK
** Close the context, check again after 500ms.
EXPECTED (internals.audioSessionCategory() == 'AmbientSound') OK
** And check again after 3 seconds.
EXPECTED (internals.audioSessionCategory() == 'None') OK
** MediaStream test **
** Check category before capture begins.
EXPECTED (internals.audioSessionCategory() == 'None') OK
** Check category when capturing.
EXPECTED (internals.audioSessionCategory() == 'PlayAndRecord') OK
** Check after MediaStream is attached to audio element.
RUN(video.play())
EVENT(playing)
EXPECTED (internals.audioSessionCategory() == 'PlayAndRecord') OK
** Check after MediaStream muting audio track.
EXPECTED (internals.audioSessionCategory() == 'PlayAndRecord') OK
** Check 500ms after MediaStream stopping capture.
EXPECTED (internals.audioSessionCategory() == 'PlayAndRecord') OK
** And check again after 3 seconds.
EXPECTED (internals.audioSessionCategory() == 'None') OK
END OF TEST