2011-04-07 Nancy Piedra <nancy.piedra@nokia.com>
[WebKit-https.git] / LayoutTests / media / video-can-play-type.html
1 <html>
2     <head>
3         <style>
4             video { background-color: yellow; width: 320px; height: 240px;} 
5         </style>
6     </head>
7     <body>
8
9         <video controls ></video>
10
11         <p>Test HTMLMediaElement <em>canPlayType()</em> method.</p>
12
13         <script src=video-test.js></script>
14         <script>
15         
16             video = mediaElement = document.getElementsByTagName('video')[0];
17
18             testExpected("video.canPlayType()", "");
19             testExpected("video.canPlayType('video/')", "");
20             testExpected("video.canPlayType('video/blahblah')", "");
21             testExpected("video.canPlayType('video/mpeg; Codecs=\"avc1.4D400C\"')", "probably");
22             testExpected("video.canPlayType('        Video/MP4 ; CODECS=\"mp4v.20.8, mp4a.40.2\"')", "probably");
23             testExpected("video.canPlayType('audio/mpeg')", "maybe");
24             testExpected("video.canPlayType('audio/Wav')", "maybe");
25             testExpected("video.canPlayType('video/blahblah; codecs=blah')", "");
26             testExpected("video.canPlayType('video/blahblah; codecs=\"blah\"')", "");
27             testExpected("video.canPlayType('video/blahblah; codecs=\"badcontent')", "");
28             testExpected("video.canPlayType('video/blahblah; codecs=badcontent\"')", "");
29             testExpected("video.canPlayType('video/blahblah; codecs=&quot;badcontent&quot;')", "");
30
31             endTest();
32         </script>
33     </body>
34 </html>