Index: third_party/WebKit/LayoutTests/media/video-currentTime-set.html |
diff --git a/third_party/WebKit/LayoutTests/media/video-currentTime-set.html b/third_party/WebKit/LayoutTests/media/video-currentTime-set.html |
index d8689ad568fef0692b84a7ad4b721dd8415d0868..614144bfe264f0426841e17257a9b739c4b1f11e 100644 |
--- a/third_party/WebKit/LayoutTests/media/video-currentTime-set.html |
+++ b/third_party/WebKit/LayoutTests/media/video-currentTime-set.html |
@@ -1,32 +1,25 @@ |
-<html> |
-<body> |
+<!DOCTYPE html> |
+<title>Test that setting currentTime changes the time, and that "ended" event is fired in a reasonable amount of time.</title> |
+<script src="../resources/testharness.js"></script> |
+<script src="../resources/testharnessreport.js"></script> |
+<script src="media-file.js"></script> |
+<video></video> |
+<script> |
+async_test(function(t) { |
+ var video = document.querySelector("video"); |
- <video controls></video> |
- |
- <p>Test that setting currentTime changes the time, and that 'ended' event is fired in a reasonable amount of time</p> |
- |
- <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> |
- waitForEventOnce('canplaythrough', |
- function () { |
- waitForEventAndEnd('ended'); |
- |
- testExpected("video.currentTime", 0); |
- run("video.currentTime = video.duration - 0.2"); |
+ video.oncanplaythrough = t.step_func(function () { |
+ video.oncanplaythrough = null; |
+ video.onended = t.step_func_done(); |
+ assert_equals(video.currentTime, 0); |
+ video.currentTime = video.duration - 0.2; |
}); |
- waitForEvent('seeked', |
- function () { |
- testExpected("video.currentTime.toFixed(2)", (video.duration - 0.2).toFixed(2)); |
- run("video.play()"); |
- consoleWrite(""); |
+ video.onseeked = t.step_func(function () { |
+ assert_equals(video.currentTime.toFixed(2), (video.duration - 0.2).toFixed(2)); |
+ video.play(); |
}); |
video.src = findMediaFile("video", "content/test"); |
- </script> |
- |
-</body> |
-</html> |
+}); |
+</script> |