Index: third_party/WebKit/LayoutTests/media/video-seekable.html |
diff --git a/third_party/WebKit/LayoutTests/media/video-seekable.html b/third_party/WebKit/LayoutTests/media/video-seekable.html |
index 87d4ce72268d3b73d56851b964f12c9145379556..0625483f3e8334a52efff8cc0829ad154849489a 100644 |
--- a/third_party/WebKit/LayoutTests/media/video-seekable.html |
+++ b/third_party/WebKit/LayoutTests/media/video-seekable.html |
@@ -1,27 +1,29 @@ |
-<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>Test video "seekable" properties.</title> |
+<script src="../resources/testharness.js"></script> |
+<script src="../resources/testharnessreport.js"></script> |
+<script src="media-file.js"></script> |
+<video></video> |
<script> |
- testExpected("video.seekable.length", 0); |
- testDOMException("video.seekable.start(-1)", "DOMException.INDEX_SIZE_ERR"); |
- testDOMException("video.seekable.end(-1)", "DOMException.INDEX_SIZE_ERR"); |
- testDOMException("video.seekable.start(0)", "DOMException.INDEX_SIZE_ERR"); |
- testDOMException("video.seekable.end(0)", "DOMException.INDEX_SIZE_ERR"); |
- waitForEvent("loadedmetadata", |
- function () |
- { |
- testExpected("video.seekable.length", 1); |
- testExpected("video.seekable.start(0)", 0); |
- testExpected("video.seekable.end(0)", 5, ">"); |
- testExpected("video.seekable.end(0)", 7, "<"); |
- testDOMException("video.seekable.start(-1)", "DOMException.INDEX_SIZE_ERR"); |
- testDOMException("video.seekable.end(-1)", "DOMException.INDEX_SIZE_ERR"); |
- testDOMException("video.seekable.start(1)", "DOMException.INDEX_SIZE_ERR"); |
- testDOMException("video.seekable.end(1)", "DOMException.INDEX_SIZE_ERR"); |
- endTest(); |
- } |
- ); |
+async_test(function(t) { |
+ var video = document.querySelector("video"); |
+ assert_equals(video.seekable.length, 0); |
+ assert_throws("IndexSizeError", function() { video.seekable.start(-1); }); |
+ assert_throws("IndexSizeError", function() { video.seekable.end(-1); }); |
+ assert_throws("IndexSizeError", function() { video.seekable.start(0); }); |
+ assert_throws("IndexSizeError", function() { video.seekable.end(0); }); |
+ |
+ video.onloadedmetadata = t.step_func_done(function () { |
+ assert_equals(video.seekable.length, 1); |
+ assert_equals(video.seekable.start(0), 0); |
+ assert_greater_than(video.seekable.end(0), 5); |
+ assert_less_than(video.seekable.end(0), 7); |
+ assert_throws("IndexSizeError", function() { video.seekable.start(-1); }); |
+ assert_throws("IndexSizeError", function() { video.seekable.end(-1); }); |
+ assert_throws("IndexSizeError", function() { video.seekable.start(1); }); |
+ assert_throws("IndexSizeError", function() { video.seekable.end(1); }); |
+ }); |
+ |
video.src = findMediaFile("video", "content/test"); |
-</script> |
+}); |
+</script> |