media-blocked-by-beforeload-expected.txt 979 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
Test to ensure that a media file blocked by a beforeload handler generates an error and does not block the document's 'load' event.

*** Test initial state ***
EXPECTED (video.networkState == '0') OK
EXPECTED (video.error == 'null') OK

*** Test blocking the 'src' attribute ***

EVENT('beforeload')
EXPECTED (event.target.tagName == 'VIDEO') OK
blocking load of 'src'

EVENT('loadstart')

EVENT('error')
EXPECTED (event.target.tagName == 'VIDEO') OK
EXPECTED (video.error != 'null') OK
EXPECTED (video.error.code == '4') OK
EXPECTED (video.networkState == '3') OK

*** Test using the <source> element ***

EVENT('beforeload')
EXPECTED (event.target.tagName == 'VIDEO') OK
blocking load of first <source> element

EVENT('beforeload')
EXPECTED (event.target.tagName == 'VIDEO') OK
allowing load of second <source> element

EVENT('loadstart')

EVENT('error')
EXPECTED (event.target.tagName == 'SOURCE') OK
EXPECTED (video.error == 'null') OK

EVENT('loadedmetadata')

END OF TEST