OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 </head> | 3 </head> |
4 <body onload="loadCookieAndReferer()"> | 4 <body onload="loadCookieAndReferer()"> |
5 <video id="video"> | 5 <video id="video"> |
6 <source id="source"> | 6 <source id="source"> |
7 </video> | 7 </video> |
| 8 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 |
| 9 (Please avoid writing new tests using video-test.js) --> |
8 <script src=../../media-resources/video-test.js></script> | 10 <script src=../../media-resources/video-test.js></script> |
9 <script src=../../media-resources/media-file.js></script> | 11 <script src=../../media-resources/media-file.js></script> |
10 <script> | 12 <script> |
11 function loadCookieAndReferer () { | 13 function loadCookieAndReferer () { |
12 var movie = findMediaFile('video', 'test'); | 14 var movie = findMediaFile('video', 'test'); |
13 var type = mimeTypeForExtension(movie.split('.').pop()); | 15 var type = mimeTypeForExtension(movie.split('.').pop()); |
14 var frame = document.createElement('iframe'); | 16 var frame = document.createElement('iframe'); |
15 frame.width = 0; | 17 frame.width = 0; |
16 frame.height = 0; | 18 frame.height = 0; |
17 frame.addEventListener('load', function () { | 19 frame.addEventListener('load', function () { |
18 source = document.getElementById('source'); | 20 source = document.getElementById('source'); |
19 source.src = 'http://127.0.0.1:8000/media/resources/video-refere
r-check-referer.php?name=' + movie + '&type=' + type; | 21 source.src = 'http://127.0.0.1:8000/media/resources/video-refere
r-check-referer.php?name=' + movie + '&type=' + type; |
20 source.type = type; | 22 source.type = type; |
21 | 23 |
22 waitForEventAndFail('error'); | 24 waitForEventAndFail('error'); |
23 waitForEventAndEnd('canplay'); | 25 waitForEventAndEnd('canplay'); |
24 video.load(); | 26 video.load(); |
25 }); | 27 }); |
26 | 28 |
27 frame.src = "data:text/html,<b>test</b>"; | 29 frame.src = "data:text/html,<b>test</b>"; |
28 document.body.appendChild(frame); | 30 document.body.appendChild(frame); |
29 } | 31 } |
30 </script> | 32 </script> |
31 Tests that the media player will send the relevant referer when requesting the m
edia file.<br/> | 33 Tests that the media player will send the relevant referer when requesting the m
edia file.<br/> |
32 </body> | 34 </body> |
33 </html> | 35 </html> |
OLD | NEW |