Index: third_party/WebKit/LayoutTests/media/media-can-play-webm.html |
diff --git a/third_party/WebKit/LayoutTests/media/media-can-play-webm.html b/third_party/WebKit/LayoutTests/media/media-can-play-webm.html |
index 3b195de1907b68a4b25744341d5e648c6ebddc59..a9fc822f0490c7d914f4496e715c52c41a576319 100644 |
--- a/third_party/WebKit/LayoutTests/media/media-can-play-webm.html |
+++ b/third_party/WebKit/LayoutTests/media/media-can-play-webm.html |
@@ -1,42 +1,32 @@ |
<!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 start() { |
- video = mediaElement = document.getElementsByTagName('video')[0]; |
+<title>Test HTMLMediaElement's "canPlayType" method for webm media containers.</title> |
+<script src="../resources/testharness.js"></script> |
+<script src="../resources/testharnessreport.js"></script> |
+<video></video> |
+<script> |
+test(function() { |
+ var video = document.querySelector("video"); |
+ // These tests may be expected to fail if the platform does not support the format. |
+ assert_equals(video.canPlayType("audio/webm"), "maybe"); |
+ assert_equals(video.canPlayType("video/webm"), "maybe"); |
- testExpected("video.canPlayType('audio/webm')", "maybe"); |
- testExpected("video.canPlayType('video/webm')", "maybe"); |
+ assert_equals(video.canPlayType("audio/webm; codecs=vorbis"), "probably"); |
+ assert_equals(video.canPlayType("video/webm; codecs=vp8,vorbis"), "probably"); |
+ assert_equals(video.canPlayType("video/webm; codecs=vp8"), "probably"); |
+ assert_equals(video.canPlayType("video/webm; codecs=vp8.0"), "probably"); |
+ assert_equals(video.canPlayType("video/webm; codecs=vp8.0,vorbis"), "probably"); |
+ assert_equals(video.canPlayType("video/webm; codecs=vp8.1"), ""); |
- testExpected("video.canPlayType('audio/webm; codecs=vorbis')", "probably"); |
- testExpected("video.canPlayType('video/webm; codecs=vp8,vorbis')", "probably"); |
- testExpected("video.canPlayType('video/webm; codecs=vp8')", "probably"); |
- testExpected("video.canPlayType('video/webm; codecs=vp8.0')", "probably"); |
- testExpected("video.canPlayType('video/webm; codecs=vp8.0,vorbis')", "probably"); |
- testExpected("video.canPlayType('video/webm; codecs=vp8.1')", ""); |
+ assert_equals(video.canPlayType("video/webm; codecs=vp9"), "probably"); |
+ assert_equals(video.canPlayType("video/webm; codecs=vp9,vorbis"), "probably"); |
+ assert_equals(video.canPlayType("video/webm; codecs=vp9.0"), "probably"); |
+ assert_equals(video.canPlayType("video/webm; codecs=vp9.0,vorbis"), "probably"); |
+ assert_equals(video.canPlayType("video/webm; codecs=vp9.1"), ""); |
- testExpected("video.canPlayType('video/webm; codecs=vp9')", "probably"); |
- testExpected("video.canPlayType('video/webm; codecs=vp9,vorbis')", "probably"); |
- testExpected("video.canPlayType('video/webm; codecs=vp9.0')", "probably"); |
- testExpected("video.canPlayType('video/webm; codecs=vp9.0,vorbis')", "probably"); |
- testExpected("video.canPlayType('video/webm; codecs=vp9.1')", ""); |
- |
- testExpected("video.canPlayType('audio/webm; codecs=opus')", "probably"); |
- testExpected("video.canPlayType('video/webm; codecs=vp9,opus')", "probably"); |
- testExpected("video.canPlayType('video/webm; codecs=vp9.0,opus')", "probably"); |
- testExpected("video.canPlayType('video/webm; codecs=vp8,opus')", "probably"); |
- testExpected("video.canPlayType('video/webm; codecs=vp8.0,opus')", "probably"); |
- |
- endTest(); |
- } |
- </script> |
- </head> |
- <body onload="start()"> |
- <video controls></video> |
- <p>Test HTMLMediaElement <em>canPlayType()</em> method for webm media containers.</p> |
- <p>These tests may be expected to fail if the WebKit port does not support the format.</p> |
- </body> |
-</html> |
+ assert_equals(video.canPlayType("audio/webm; codecs=opus"), "probably"); |
+ assert_equals(video.canPlayType("video/webm; codecs=vp9,opus"), "probably"); |
+ assert_equals(video.canPlayType("video/webm; codecs=vp9.0,opus"), "probably"); |
+ assert_equals(video.canPlayType("video/webm; codecs=vp8,opus"), "probably"); |
+ assert_equals(video.canPlayType("video/webm; codecs=vp8.0,opus"), "probably"); |
+}); |
+</script> |