OLD | NEW |
1 <html> | 1 <!DOCTYPE html> |
2 <head> | 2 <title>Tests that a media document can open a media URL with an ambiguous extens
ion.</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 <script> |
8 var frame; | 8 async_test(function(t) { |
9 function loadMediaFrame() | 9 var movie = findMediaFile('video', 'test'); |
10 { | 10 var type = mimeTypeForExtension(movie.split('.').pop()); |
11 var movie = findMediaFile('video', 'test'); | 11 var iframe = document.createElement('iframe'); |
12 var type = mimeTypeForExtension(movie.split('.').pop()); | |
13 frame = document.createElement('iframe'); | |
14 frame.addEventListener('load', function () { | |
15 testExpected("frame.contentDocument.getElementsByTagName('vi
deo')[0].error", null); | |
16 endTest(); | |
17 }); | |
18 waitForEventAndFail('error'); | |
19 waitForEventAndEnd('canplay'); | |
20 frame.src = 'resources/video-check-useragent.php?name=' + movie
+ '&type=' + type; | |
21 document.body.appendChild(frame); | |
22 } | |
23 </script> | |
24 </head> | |
25 | 12 |
26 <body onload="loadMediaFrame()"> | 13 iframe.onload = t.step_func_done(function() { |
27 <br> | 14 assert_equals(iframe.contentDocument.querySelector('video').error, null)
; |
28 Tests that a media document can open a media URL with an ambiguous exten
sion. | 15 }); |
29 <br> | 16 |
30 </body> | 17 iframe.src = 'resources/video-check-useragent.php?name=' + movie + '&type='
+ type; |
31 </html> | 18 document.body.appendChild(iframe); |
| 19 }); |
| 20 </script> |
OLD | NEW |