Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: third_party/WebKit/LayoutTests/media/media-can-play-ogg.html

Issue 2028463002: Convert media-can-* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/media/media-can-play-ogg.html
diff --git a/third_party/WebKit/LayoutTests/media/media-can-play-ogg.html b/third_party/WebKit/LayoutTests/media/media-can-play-ogg.html
index f3cd8f8379dae23179ce9fd405071befc0241e86..69bc8dc565ab599b19e034f8517d8a6d86e2e0e1 100644
--- a/third_party/WebKit/LayoutTests/media/media-can-play-ogg.html
+++ b/third_party/WebKit/LayoutTests/media/media-can-play-ogg.html
@@ -1,28 +1,18 @@
<!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 ogg 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/ogg"), "maybe");
+ assert_equals(video.canPlayType("video/ogg"), "maybe");
- testExpected("video.canPlayType('audio/ogg')", "maybe");
- testExpected("video.canPlayType('video/ogg')", "maybe");
-
- testExpected("video.canPlayType('audio/ogg; codecs=vorbis')", "probably");
- testExpected("video.canPlayType('audio/ogg; codecs=opus')", "probably");
- testExpected("video.canPlayType('video/ogg; codecs=theora')", "probably");
- testExpected("video.canPlayType('video/ogg; codecs=theora,vorbis')", "probably");
-
- endTest();
- }
- </script>
- </head>
- <body onload="start()">
- <video controls></video>
- <p>Test HTMLMediaElement <em>canPlayType()</em> method for ogg 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/ogg; codecs=vorbis"), "probably");
+ assert_equals(video.canPlayType("audio/ogg; codecs=opus"), "probably");
+ assert_equals(video.canPlayType("video/ogg; codecs=theora"), "probably");
+ assert_equals(video.canPlayType("video/ogg; codecs=theora,vorbis"), "probably");
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698