Index: third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata-media-fragment-uri.html |
diff --git a/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata-media-fragment-uri.html b/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata-media-fragment-uri.html |
index 870bd6a67328f28b755be5d36a539eec099bd846..453517dbc2472ca97b8683b5871b90ce19429914 100644 |
--- a/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata-media-fragment-uri.html |
+++ b/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata-media-fragment-uri.html |
@@ -1,27 +1,20 @@ |
<!DOCTYPE html> |
-<html> |
- <head> |
- <title>Test currentTime values when setting while HAVE_NOTHING for media fragment URI.</title> |
- </head> |
- <body> |
- <video id="video"></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> |
- video = document.getElementById('video'); |
+<title>Test currentTime values when setting while readystate is HAVE_NOTHING for media fragment URI.</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") + "#t=2"; |
+ assert_equals(video.currentTime, 0); |
+ video.currentTime = 1; |
- video.src = findMediaFile("video", "content/test") + "#t=2"; |
- testExpected("video.currentTime", 0); |
- video.currentTime = 1; |
+ video.onloadedmetadata = t.step_func(function() { |
+ assert_equals(video.currentTime, 1); |
+ }); |
- waitForEvent('loadedmetadata', function() |
- { |
- testExpected("video.currentTime", 1); |
- }); |
- |
- waitForEventAndEnd('seeked'); |
- </script> |
- </body> |
-</html> |
+ video.onseeked = t.step_func_done(); |
+}); |
+</script> |