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