OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE HTML> |
| 2 <html> |
| 3 <head> |
| 4 <title>Video element src attribute must match src list - negative test</titl
e> |
| 5 <meta name=timeout content=long> |
| 6 <script src='/resources/testharness.js'></script> |
| 7 <script src='/resources/testharnessreport.js'></script> |
| 8 </head> |
| 9 <body> |
| 10 <h1>Video element src attribute must match src list - negative test</h1> |
| 11 <div id='log'></div> |
| 12 |
| 13 <script> |
| 14 var src_test = async_test("Disallowed async video src"); |
| 15 var source_test = async_test("Disallowed async video source element"); |
| 16 |
| 17 // we assume tests are run from 'hostname' and 'www.hostname' or 'www2.hos
tname' is a valid alias |
| 18 var mediaURL = location.protocol + |
| 19 "//www2." + |
| 20 location.hostname + |
| 21 ":" + |
| 22 location.port + |
| 23 "/media/white.mp4"; |
| 24 |
| 25 function media_loaded(t) { |
| 26 t.step( function () { |
| 27 assert_unreached("Media error handler should be triggered for non-allo
wed domain."); |
| 28 }); |
| 29 t.done(); |
| 30 } |
| 31 |
| 32 function media_error_handler(t) { |
| 33 t.done(); |
| 34 } |
| 35 </script> |
| 36 |
| 37 <video id="videoObject" width="320" height="240" controls |
| 38 onloadeddata="media_loaded(source_test)"> |
| 39 <source id="videoSourceObject" |
| 40 type="video/mp4" |
| 41 onerror="media_error_handler(source_test)"> |
| 42 </video> |
| 43 <video id="videoObject2" width="320" height="240" controls |
| 44 onerror="media_error_handler(src_test)" |
| 45 onloadeddata="media_loaded(src_test)"> |
| 46 |
| 47 <script> |
| 48 document.getElementById("videoSourceObject").src = mediaURL; |
| 49 document.getElementById("videoObject2").src = mediaURL; |
| 50 </script> |
| 51 |
| 52 <script async defer src='../support/checkReport.sub.js?reportField=violated-
directive&reportValue=media-src%20%27self%27'></script> |
| 53 |
| 54 </body> |
| 55 </html> |
OLD | NEW |