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> <source> @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> |