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

Unified Diff: third_party/WebKit/LayoutTests/media/media-can-play-octet-stream.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-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..8d38917aba9f9997eec7bcc24181acf7ae224b79 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,19 @@
<!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>
+<script>
+function check_media_element_canplaytype(elementName) {
+ test(function() {
+ var mediaElement = document.createElement(elementName);
+ // 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 " + elementName);
+}
- function start()
- {
- consoleWrite("<em>++ Test with &lt;video&gt; element.</em>");
- mediaElement = document.getElementsByTagName('video')[0];
- test();
-
- consoleWrite("<br><em>++ Test with &lt;audio&gt; 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>
+check_media_element_canplaytype("audio");
+check_media_element_canplaytype("video");
+</script>

Powered by Google App Engine
This is Rietveld 408576698