Index: third_party/WebKit/LayoutTests/media/media-can-play-octet-stream.html |
diff --git a/third_party/WebKit/LayoutTests/media/media-can-play-octet-stream.html b/third_party/WebKit/LayoutTests/media/media-can-play-octet-stream.html |
index 1cd108a64232f23b0fb2a640c6982a0034ad4836..e8bc9a07b2ec3efb579c756e0df1a3f79806f4b4 100644 |
--- a/third_party/WebKit/LayoutTests/media/media-can-play-octet-stream.html |
+++ b/third_party/WebKit/LayoutTests/media/media-can-play-octet-stream.html |
@@ -1,34 +1,22 @@ |
<!DOCTYPE html> |
-<html> |
- <head> |
- <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 |
- (Please avoid writing new tests using video-test.js) --> |
- <script src="video-test.js"></script> |
- <script> |
- function test() |
- { |
- testExpected("mediaElement.canPlayType('APPLICATION/octet-stream')", ""); |
- testExpected("mediaElement.canPlayType('application/octet-stream;codecs=theora')", ""); |
- testExpected("mediaElement.canPlayType('application/octet-stream;codecs=mp4')", ""); |
- } |
+<title>Test HTMLMediaElement's "canPlayType" method with "application/octet-stream".</title> |
+<script src="../resources/testharness.js"></script> |
+<script src="../resources/testharnessreport.js"></script> |
+<video></video> |
+<script> |
+function check_media_element_canplaytype(mediaElement) { |
+ test(function() { |
+ // These tests should always pass as no platform |
+ // should support "application/octet-stream". |
+ assert_equals(mediaElement.canPlayType("APPLICATION/octet-stream"), ""); |
+ assert_equals(mediaElement.canPlayType("application/octet-stream;codecs=theora"), ""); |
+ assert_equals(mediaElement.canPlayType("application/octet-stream;codecs=mp4"), ""); |
+ }, "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.
|
+} |
- function start() |
- { |
- consoleWrite("<em>++ Test with <video> element.</em>"); |
- mediaElement = document.getElementsByTagName('video')[0]; |
- test(); |
+var video = document.querySelector("video"); |
+check_media_element_canplaytype(video); |
- consoleWrite("<br><em>++ Test with <audio> element.</em>"); |
- mediaElement = new Audio(); |
- test(); |
- |
- endTest(); |
- } |
- </script> |
- </head> |
- <body onload="start()"> |
- <video controls></video> |
- <p>Test HTMLMediaElement <em>canPlayType()</em> method with "application/octet-stream".</p> |
- <p>These tests should always pass as no WebKit port should support "application/octet-stream".</p> |
- </body> |
-</html> |
+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
|
+check_media_element_canplaytype(audio); |
+</script> |