OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <title>Test HTMLMediaElement's "canPlayType" method for webm media containers.</
title> |
3 <head> | 3 <script src="../resources/testharness.js"></script> |
4 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 | 4 <script src="../resources/testharnessreport.js"></script> |
5 (Please avoid writing new tests using video-test.js) --> | 5 <video></video> |
6 <script src="video-test.js"></script> | 6 <script> |
7 <script> | 7 test(function() { |
8 function start() { | 8 var video = document.querySelector("video"); |
9 video = mediaElement = document.getElementsByTagName('video')[0]
; | 9 // These tests may be expected to fail if the platform does not support the
format. |
| 10 assert_equals(video.canPlayType("audio/webm"), "maybe"); |
| 11 assert_equals(video.canPlayType("video/webm"), "maybe"); |
10 | 12 |
11 testExpected("video.canPlayType('audio/webm')", "maybe"); | 13 assert_equals(video.canPlayType("audio/webm; codecs=vorbis"), "probably"); |
12 testExpected("video.canPlayType('video/webm')", "maybe"); | 14 assert_equals(video.canPlayType("video/webm; codecs=vp8,vorbis"), "probably"
); |
| 15 assert_equals(video.canPlayType("video/webm; codecs=vp8"), "probably"); |
| 16 assert_equals(video.canPlayType("video/webm; codecs=vp8.0"), "probably"); |
| 17 assert_equals(video.canPlayType("video/webm; codecs=vp8.0,vorbis"), "probabl
y"); |
| 18 assert_equals(video.canPlayType("video/webm; codecs=vp8.1"), ""); |
13 | 19 |
14 testExpected("video.canPlayType('audio/webm; codecs=vorbis')", "
probably"); | 20 assert_equals(video.canPlayType("video/webm; codecs=vp9"), "probably"); |
15 testExpected("video.canPlayType('video/webm; codecs=vp8,vorbis')
", "probably"); | 21 assert_equals(video.canPlayType("video/webm; codecs=vp9,vorbis"), "probably"
); |
16 testExpected("video.canPlayType('video/webm; codecs=vp8')", "pro
bably"); | 22 assert_equals(video.canPlayType("video/webm; codecs=vp9.0"), "probably"); |
17 testExpected("video.canPlayType('video/webm; codecs=vp8.0')", "p
robably"); | 23 assert_equals(video.canPlayType("video/webm; codecs=vp9.0,vorbis"), "probabl
y"); |
18 testExpected("video.canPlayType('video/webm; codecs=vp8.0,vorbis
')", "probably"); | 24 assert_equals(video.canPlayType("video/webm; codecs=vp9.1"), ""); |
19 testExpected("video.canPlayType('video/webm; codecs=vp8.1')", ""
); | |
20 | 25 |
21 testExpected("video.canPlayType('video/webm; codecs=vp9')", "pro
bably"); | 26 assert_equals(video.canPlayType("audio/webm; codecs=opus"), "probably"); |
22 testExpected("video.canPlayType('video/webm; codecs=vp9,vorbis')
", "probably"); | 27 assert_equals(video.canPlayType("video/webm; codecs=vp9,opus"), "probably"); |
23 testExpected("video.canPlayType('video/webm; codecs=vp9.0')", "p
robably"); | 28 assert_equals(video.canPlayType("video/webm; codecs=vp9.0,opus"), "probably"
); |
24 testExpected("video.canPlayType('video/webm; codecs=vp9.0,vorbis
')", "probably"); | 29 assert_equals(video.canPlayType("video/webm; codecs=vp8,opus"), "probably"); |
25 testExpected("video.canPlayType('video/webm; codecs=vp9.1')", ""
); | 30 assert_equals(video.canPlayType("video/webm; codecs=vp8.0,opus"), "probably"
); |
26 | 31 }); |
27 testExpected("video.canPlayType('audio/webm; codecs=opus')", "pr
obably"); | 32 </script> |
28 testExpected("video.canPlayType('video/webm; codecs=vp9,opus')",
"probably"); | |
29 testExpected("video.canPlayType('video/webm; codecs=vp9.0,opus')
", "probably"); | |
30 testExpected("video.canPlayType('video/webm; codecs=vp8,opus')",
"probably"); | |
31 testExpected("video.canPlayType('video/webm; codecs=vp8.0,opus')
", "probably"); | |
32 | |
33 endTest(); | |
34 } | |
35 </script> | |
36 </head> | |
37 <body onload="start()"> | |
38 <video controls></video> | |
39 <p>Test HTMLMediaElement <em>canPlayType()</em> method for webm media co
ntainers.</p> | |
40 <p>These tests may be expected to fail if the WebKit port does not suppo
rt the format.</p> | |
41 </body> | |
42 </html> | |
OLD | NEW |