Index: third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata.html |
diff --git a/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata.html b/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata.html |
index 2d10b858fdfa61594293ccf5a98d5d2ed1b558b4..4bea570850719eed23cb834fef43390fb0135b45 100644 |
--- a/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata.html |
+++ b/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata.html |
@@ -1,34 +1,21 @@ |
<!DOCTYPE html> |
-<html> |
- <head> |
- <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> |
- function onWindowLoad(e) |
- { |
- video = document.getElementById('video'); |
+<title>Test currentTime values when setting while readystate is HAVE_NOTHING.</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.src = findMediaFile("video", "content/test"); |
+ assert_equals(video.currentTime, 0); |
+ video.currentTime = 1; |
+ assert_equals(video.currentTime, 1); |
- video.src = findMediaFile("video", "content/test"); |
- testExpected("video.currentTime", 0); |
- video.currentTime = 1; |
- testExpected("video.currentTime", 1); |
+ video.onloadedmetadata = t.step_func(function() { |
+ assert_equals(video.currentTime, 1); |
+ }); |
- waitForEvent('loadedmetadata', function() |
- { |
- testExpected("video.currentTime", 1); |
- }); |
- |
- waitForEventAndEnd('seeked'); |
- } |
- |
- window.addEventListener('load', onWindowLoad, false); |
- </script> |
- </head> |
- <body> |
- <video controls id="video"></video> |
- <p>Test currentTime values when setting while HAVE_NOTHING.</p> |
- <br/> |
- </body> |
-</html> |
+ video.onseeked = t.step_func_done(); |
+}); |
+</script> |