OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE HTML> |
| 2 <html> |
| 3 <head> |
| 4 <title>Video track src attribute must match src list - negative test</title> |
| 5 <script src='/resources/testharness.js'></script> |
| 6 <script src='/resources/testharnessreport.js'></script> |
| 7 </head> |
| 8 <body> |
| 9 <h1>Video track src attribute must match src list - negative test</h1> |
| 10 <div id='log'></div> |
| 11 |
| 12 <script> |
| 13 var source_test = |
| 14 async_test("Disallowed track element onerror handler fires."); |
| 15 |
| 16 var trackURL = location.protocol + |
| 17 "//www." + |
| 18 location.hostname + |
| 19 ":" + |
| 20 location.port + |
| 21 "/media/foo.vtt"; |
| 22 |
| 23 function media_loaded(t) { |
| 24 t.step( function () { |
| 25 assert_unreached("Disllowed track source loaded."); |
| 26 }); |
| 27 t.done(); |
| 28 } |
| 29 |
| 30 function media_error_handler(t) { |
| 31 t.done(); |
| 32 } |
| 33 </script> |
| 34 |
| 35 <video id="videoObject" width="320" height="240" controls |
| 36 onerror="media_error_handler(source_test)" |
| 37 crossorigin> |
| 38 <source id="audioSourceObject" |
| 39 type="audio/mpeg" |
| 40 src="/media/white.mp4"> |
| 41 <track default |
| 42 id="trackObject" |
| 43 kind="subtitles" |
| 44 srclang="en" |
| 45 label="English" |
| 46 onerror="media_error_handler(source_test)" |
| 47 onload="media_loaded(source_test)" |
| 48 onloadeddata="media_loaded(source_test)"> |
| 49 </video> |
| 50 <script> |
| 51 document.getElementById("trackObject").src = trackURL; |
| 52 source_test.step(function() { |
| 53 source_test.set_status(source_test.FAIL); |
| 54 }); |
| 55 |
| 56 setTimeout(function() { |
| 57 if(source_test.phase != source_test.phases.COMPLETE) { |
| 58 source_test.step( function () { assert_unreached("Onerror event
never fired for track element."); }); |
| 59 source_test.done(); |
| 60 } |
| 61 }, 2 * 1000); |
| 62 </script> |
| 63 |
| 64 <script async defer src="../support/checkReport.sub.js?reportField=violated-di
rective&reportValue=media-src%20%27self%27"> |
| 65 </script> |
| 66 |
| 67 </body> |
| 68 </html> |
OLD | NEW |