Index: third_party/WebKit/LayoutTests/media/video-append-source.html |
diff --git a/third_party/WebKit/LayoutTests/media/video-append-source.html b/third_party/WebKit/LayoutTests/media/video-append-source.html |
index 5dbcb0cb911ba72f125544102216871be8c81efb..4a97b681db06c392a111b1e3ff6657bfea219364 100644 |
--- a/third_party/WebKit/LayoutTests/media/video-append-source.html |
+++ b/third_party/WebKit/LayoutTests/media/video-append-source.html |
@@ -1,21 +1,23 @@ |
-<video controls></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> |
- |
+<!DOCTYPE html> |
+<title>Verify that a media element's currentSrc is correctly set to source element's src</title> |
+<script src="../resources/testharness.js"></script> |
+<script src="../resources/testharnessreport.js"></script> |
+<script src="media-file.js"></script> |
+<video></video> |
<script> |
- testExpected("video.currentSrc", ""); |
+async_test(function(t) { |
+ var video = document.querySelector("video"); |
+ assert_equals(video.currentSrc, ""); |
var mediaFile = findMediaFile("video", "content/test"); |
var source = document.createElement("source"); |
- source.setAttribute("src", mediaFile); |
+ source.src = mediaFile; |
video.appendChild(source); |
- testExpected("video.currentSrc", ""); |
+ assert_equals(video.currentSrc, ""); |
- waitForEvent("canplaythrough", function () { |
- testExpected("stripExtension(relativeURL(video.currentSrc))", stripExtension(mediaFile)); |
- endTest(); |
+ video.oncanplaythrough = t.step_func_done(function () { |
+ var currentSrc = video.currentSrc; |
+ assert_equals(currentSrc.substr(currentSrc.lastIndexOf('/media/')+7), mediaFile); |
}); |
- |
-</script> |
+}); |
+</script> |