OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <title>Test "source" element "type" attribute.</title> |
3 <head> | 3 <script src="../resources/testharness.js"></script> |
4 <title> <source> @type attribute</title> | 4 <script src="../resources/testharnessreport.js"></script> |
| 5 <script src="media-file.js"></script> |
| 6 <video> |
| 7 <source src=content/error.mpeg type=video/blahblah> |
| 8 <source src=test.mp4 type=video/x-chicken-face> |
| 9 <source src=test.ogv type=audio/x-higglety-pigglety> |
| 10 <source src=content/test.mp4 type=video/mp4> |
| 11 <source src=content/test.ogv type=video/ogg> |
| 12 <source src=content/error2.mpeg type=video/mpeg> |
| 13 </video> |
| 14 <script> |
| 15 async_test(function(t) { |
| 16 var video = document.querySelector("video"); |
5 | 17 |
6 <script src=media-file.js></script> | 18 video.onloadstart = t.step_func_done(function() { |
7 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 | 19 var url = video.currentSrc; |
8 (Please avoid writing new tests using video-test.js) --> | 20 assert_equals(url.substr(url.lastIndexOf("/media/") + 7), findMediaFile(
"video", "content/test")); |
9 <script src=video-test.js></script> | 21 }); |
10 <script> | 22 }); |
11 waitForEvent("loadstart", function () { | 23 </script> |
12 video = mediaElement = document.getElementsByTagName('video')[0]; | |
13 testExpected("stripExtension(relativeURL(video.currentSrc))", stripE
xtension(findMediaFile("video", "content/test"))); | |
14 endTest(); | |
15 }); | |
16 </script> | |
17 </head> | |
18 <body> | |
19 <video controls> | |
20 <source src=content/error.mpeg type=video/blahblah> | |
21 <source src=test.mp4 type=video/x-chicken-face> | |
22 <source src=test.ogv type=audio/x-higglety-pigglety> | |
23 <source src=content/test.mp4 type=video/mp4> | |
24 <source src=content/test.ogv type=video/ogg> | |
25 <source src=content/error2.mpeg type=video/mpeg> | |
26 </video> | |
27 </body> | |
28 </html> | |
OLD | NEW |