Index: third_party/WebKit/LayoutTests/media/media-can-play-type.html |
diff --git a/third_party/WebKit/LayoutTests/media/media-can-play-type.html b/third_party/WebKit/LayoutTests/media/media-can-play-type.html |
index 3eb3dbc4bc92fa4182faa2fb8a9979ebda49ae1d..237ed181ea56b5a0cf5cc84f93d765305c50f6f2 100644 |
--- a/third_party/WebKit/LayoutTests/media/media-can-play-type.html |
+++ b/third_party/WebKit/LayoutTests/media/media-can-play-type.html |
@@ -1,29 +1,20 @@ |
<!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 = document.getElementsByTagName('video')[0]; |
+<title>Test HTMLMediaElement's "canPlayType" method with invalid MIME types.</title> |
+<script src="../resources/testharness.js"></script> |
+<script src="../resources/testharnessreport.js"></script> |
+<video></video> |
+<script> |
+test(function() { |
+ var video = document.querySelector("video"); |
- testException("video.canPlayType()", '"TypeError: Failed to execute \'canPlayType\' on \'HTMLMediaElement\': 1 argument required, but only 0 present."'); |
- testExpected("video.canPlayType('video/')", ""); |
- testExpected("video.canPlayType('video/blahblah')", ""); |
- testExpected("video.canPlayType('video/blahblah; codecs=\"blah, , blah\"')", ""); |
- testExpected("video.canPlayType('video/blahblah; codecs=blah')", ""); |
- testExpected("video.canPlayType('video/blahblah; codecs=\"blah\"')", ""); |
- testExpected("video.canPlayType('video/blahblah; codecs=\"badcontent')", ""); |
- testExpected("video.canPlayType('video/blahblah; codecs=badcontent\"')", ""); |
- testExpected("video.canPlayType('video/blahblah; codecs="badcontent"')", ""); |
- |
- endTest(); |
- } |
- </script> |
- </head> |
- <body onload="start()"> |
- <video controls></video> |
- <p>Test HTMLMediaElement <em>canPlayType()</em> method.</p> |
- </body> |
-</html> |
+ assert_throws(new TypeError, function() { video.canPlayType(); }); |
+ assert_equals(video.canPlayType("video/"), ""); |
+ assert_equals(video.canPlayType("video/blahblah"), ""); |
+ assert_equals(video.canPlayType("video/blahblah; codecs=\"blah, , blah\""), ""); |
+ assert_equals(video.canPlayType("video/blahblah; codecs=blah"), ""); |
+ assert_equals(video.canPlayType("video/blahblah; codecs=\"blah\""), ""); |
+ assert_equals(video.canPlayType("video/blahblah; codecs=\"badcontent"), ""); |
+ assert_equals(video.canPlayType("video/blahblah; codecs=badcontent\""), ""); |
+ assert_equals(video.canPlayType("video/blahblah; codecs="badcontent""), ""); |
+}); |
+</script> |