Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <title>Test HTMLMediaElement's "canPlayType" method with "application/octet-stre am".</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 function check_media_element_canplaytype(mediaElement) { |
| 8 function test() | 8 test(function() { |
| 9 { | 9 // These tests should always pass as no platform |
| 10 testExpected("mediaElement.canPlayType('APPLICATION/octet-stream ')", ""); | 10 // should support "application/octet-stream". |
| 11 testExpected("mediaElement.canPlayType('application/octet-stream ;codecs=theora')", ""); | 11 assert_equals(mediaElement.canPlayType("APPLICATION/octet-stream"), ""); |
| 12 testExpected("mediaElement.canPlayType('application/octet-stream ;codecs=mp4')", ""); | 12 assert_equals(mediaElement.canPlayType("application/octet-stream;codecs= theora"), ""); |
| 13 } | 13 assert_equals(mediaElement.canPlayType("application/octet-stream;codecs= mp4"), ""); |
| 14 }, "check \"canPlayType\" method for " + mediaElement); | |
|
fs
2016/05/30 19:54:47
Nit: Maybe mediaElement.tagName?
foolip
2016/05/30 20:18:48
Or localName to get it it lower case
Srirama
2016/05/31 14:30:55
Done.
| |
| 15 } | |
| 14 | 16 |
| 15 function start() | 17 var video = document.querySelector("video"); |
| 16 { | 18 check_media_element_canplaytype(video); |
| 17 consoleWrite("<em>++ Test with <video> element.</em>"); | |
| 18 mediaElement = document.getElementsByTagName('video')[0]; | |
| 19 test(); | |
| 20 | 19 |
| 21 consoleWrite("<br><em>++ Test with <audio> element.</em>") ; | 20 var audio = new Audio(); |
|
foolip
2016/05/30 20:18:48
Seems kinda weird to have one in markup and create
Srirama
2016/05/31 14:30:55
Done. I thought probably they want to test one wit
foolip
2016/05/31 14:44:07
Maybe that was the idea, but there are plenty of t
| |
| 22 mediaElement = new Audio(); | 21 check_media_element_canplaytype(audio); |
| 23 test(); | 22 </script> |
| 24 | |
| 25 endTest(); | |
| 26 } | |
| 27 </script> | |
| 28 </head> | |
| 29 <body onload="start()"> | |
| 30 <video controls></video> | |
| 31 <p>Test HTMLMediaElement <em>canPlayType()</em> method with "application /octet-stream".</p> | |
| 32 <p>These tests should always pass as no WebKit port should support "appl ication/octet-stream".</p> | |
| 33 </body> | |
| 34 </html> | |
| OLD | NEW |