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

Unified Diff: third_party/WebKit/LayoutTests/media/video-source-type.html

Issue 2102433003: Convert video-source* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/video-source-type.html
diff --git a/third_party/WebKit/LayoutTests/media/video-source-type.html b/third_party/WebKit/LayoutTests/media/video-source-type.html
index b501d28b95733615cc6b232a9c62f5f6d7cb03eb..7e156f7e39dac8c07d76d15c2d3cb0355dd9e295 100644
--- a/third_party/WebKit/LayoutTests/media/video-source-type.html
+++ b/third_party/WebKit/LayoutTests/media/video-source-type.html
@@ -1,28 +1,23 @@
<!DOCTYPE html>
-<html>
-<head>
- <title> &lt;source&gt; @type attribute</title>
+<title>Test "source" element "type" attribute.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
+<video>
+ <source src=content/error.mpeg type=video/blahblah>
+ <source src=test.mp4 type=video/x-chicken-face>
+ <source src=test.ogv type=audio/x-higglety-pigglety>
+ <source src=content/test.mp4 type=video/mp4>
+ <source src=content/test.ogv type=video/ogg>
+ <source src=content/error2.mpeg type=video/mpeg>
+</video>
+<script>
+async_test(function(t) {
+ var video = document.querySelector("video");
- <script src=media-file.js></script>
- <!-- 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>
- waitForEvent("loadstart", function () {
- video = mediaElement = document.getElementsByTagName('video')[0];
- testExpected("stripExtension(relativeURL(video.currentSrc))", stripExtension(findMediaFile("video", "content/test")));
- endTest();
- });
- </script>
-</head>
-<body>
- <video controls>
- <source src=content/error.mpeg type=video/blahblah>
- <source src=test.mp4 type=video/x-chicken-face>
- <source src=test.ogv type=audio/x-higglety-pigglety>
- <source src=content/test.mp4 type=video/mp4>
- <source src=content/test.ogv type=video/ogg>
- <source src=content/error2.mpeg type=video/mpeg>
- </video>
-</body>
-</html>
+ video.onloadstart = t.step_func_done(function() {
+ var url = video.currentSrc;
+ assert_equals(url.substr(url.lastIndexOf("/media/") + 7), findMediaFile("video", "content/test"));
+ });
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698