OLD | NEW |
1 <html> | 1 <!DOCTYPE html> |
2 <head> | 2 <title>Tests that a media file specified with a query url is opened successfully
.</title> |
3 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 | 3 <script src="../resources/testharness.js"></script> |
4 (Please avoid writing new tests using video-test.js) --> | 4 <script src="../resources/testharnessreport.js"></script> |
5 <script src=../../media-resources/video-test.js></script> | 5 <script src="../../media-resources/media-file.js"></script> |
6 <script src=../../media-resources/media-file.js></script> | 6 <body> |
7 <script> | 7 <video></video> |
8 function loadMediaFrame() | 8 <script> |
9 { | 9 async_test(function(t) { |
10 findMediaElement(); | 10 var iframe = document.createElement('iframe'); |
11 | 11 |
12 var movie = findMediaFile('video', 'test'); | 12 iframe.onload = t.step_func(function() { |
13 var type = mimeTypeForExtension(movie.split('.').pop()); | 13 var movie = findMediaFile('video', 'test'); |
14 var frame = document.createElement('iframe'); | 14 var type = mimeTypeForExtension(movie.split('.').pop()); |
| 15 var video = document.querySelector('video'); |
| 16 video.onerror = t.unreached_func(); |
| 17 video.oncanplay = t.step_func_done(); |
| 18 video.src = 'http://127.0.0.1:8000/media/resources/load-video.php?name='
+ movie + '&type=' + type; |
| 19 }); |
15 | 20 |
16 frame.width = 0; | 21 iframe.src = 'data:text/html,<b>test</b>'; |
17 frame.height = 0; | 22 document.body.appendChild(iframe); |
18 frame.addEventListener('load', function () { | 23 }); |
19 video.src = 'http://127.0.0.1:8000/media/resources/load-vide
o.php?name=' + movie + '&type=' + type; | 24 </script> |
20 | |
21 waitForEventAndFail('error'); | |
22 waitForEventAndEnd('canplay'); | |
23 }); | |
24 | |
25 frame.src = "data:text/html,<b>test</b>"; | |
26 document.body.appendChild(frame); | |
27 } | |
28 </script> | |
29 </head> | |
30 | |
31 <body onload="loadMediaFrame()"> | |
32 <video controls></video> | |
33 <br> | |
34 Tests that WebKit is able to open a media file specified with a query ur
l. | |
35 </body> | |
36 </html> | |
OLD | NEW |