blob: 2a0d8d3a6d1487182de6c54bc45e306715770729 [file] [log] [blame]
CONSOLE WARNING: Resource requests whose URLs contain raw newline characters are deprecated, and may be blocked in M60, around August 2017. Please remove newlines from places like element attribute values in order to continue loading those resources. See https://www.chromestatus.com/features/5735596811091968 for more details.
This tests the constructor for the TrackEvent DOM class.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
*** No initializer passed ***
PASS new TrackEvent('TrackEvent').bubbles is false
PASS new TrackEvent('TrackEvent').cancelable is false
PASS new TrackEvent('TrackEvent').track is null
*** Bubbles and cancelable true, track is missing ***
PASS new TrackEvent('TrackEvent', { bubbles: true, cancelable: true }).bubbles is true
PASS new TrackEvent('TrackEvent', { bubbles: true, cancelable: true }).cancelable is true
PASS new TrackEvent('TrackEvent', { bubbles: true, cancelable: true }).track is null
*** Bubbles and cancelable true, invalid track ***
PASS new TrackEvent('TrackEvent', { bubbles: true, cancelable: true, track: HTMLTrackElement }).bubbles threw exception TypeError: Failed to construct 'TrackEvent': The provided value is not of type '(VideoTrack or AudioTrack or TextTrack)'.
PASS new TrackEvent('TrackEvent', { bubbles: true, cancelable: true, track: HTMLTrackElement }).cancelable threw exception TypeError: Failed to construct 'TrackEvent': The provided value is not of type '(VideoTrack or AudioTrack or TextTrack)'.
PASS new TrackEvent('TrackEvent', { bubbles: true, cancelable: true, track: HTMLTrackElement }).track threw exception TypeError: Failed to construct 'TrackEvent': The provided value is not of type '(VideoTrack or AudioTrack or TextTrack)'.
*** Initialize 'track' with a invalid values ***
PASS new TrackEvent('TrackEvent', { track: 10 }).track threw exception TypeError: Failed to construct 'TrackEvent': The provided value is not of type '(VideoTrack or AudioTrack or TextTrack)'.
PASS new TrackEvent('TrackEvent', { track: 'string' }).track threw exception TypeError: Failed to construct 'TrackEvent': The provided value is not of type '(VideoTrack or AudioTrack or TextTrack)'.
PASS new TrackEvent('TrackEvent', { track: emptyObject }).track threw exception TypeError: Failed to construct 'TrackEvent': The provided value is not of type '(VideoTrack or AudioTrack or TextTrack)'.
PASS new TrackEvent('TrackEvent', { track: document }).track threw exception TypeError: Failed to construct 'TrackEvent': The provided value is not of type '(VideoTrack or AudioTrack or TextTrack)'.
*** Bubbles and cancelable true, valid track ***
PASS new TrackEvent('TrackEvent', { bubbles: true, cancelable: true, track: trackElement.track }).bubbles is true
PASS new TrackEvent('TrackEvent', { bubbles: true, cancelable: true, track: trackElement.track }).cancelable is true
PASS new TrackEvent('TrackEvent', { track: trackElement.track }).track is trackElement.track
*** Initialize 'track' with valid track object ***
PASS new TrackEvent('TrackEvent', { track: trackElement.track }).track is trackElement.track
PASS successfullyParsed is true
TEST COMPLETE