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

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: 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..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 &lt;video&gt; element.</em>");
- mediaElement = document.getElementsByTagName('video')[0];
- test();
+var video = document.querySelector("video");
+check_media_element_canplaytype(video);
- 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>
+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>

Powered by Google App Engine
This is Rietveld 408576698