Index: third_party/WebKit/LayoutTests/media/video-currentTime-set2.html |
diff --git a/third_party/WebKit/LayoutTests/media/video-currentTime-set2.html b/third_party/WebKit/LayoutTests/media/video-currentTime-set2.html |
index f55a9c2a644596aef37aaf24aba2d942565b509f..350c0582aec13f2e49b5ad29ccfa90f31986b94c 100644 |
--- a/third_party/WebKit/LayoutTests/media/video-currentTime-set2.html |
+++ b/third_party/WebKit/LayoutTests/media/video-currentTime-set2.html |
@@ -1,20 +1,24 @@ |
-<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 that setting currentTime changes the time, and setting invalid values throw exceptions.</title> |
+<script src="../resources/testharness.js"></script> |
+<script src="../resources/testharnessreport.js"></script> |
+<script src="media-file.js"></script> |
+<video></video> |
<script> |
- waitForEvent('canplaythrough', |
- function () { |
- testException("video.currentTime = -Infinity", '"TypeError: Failed to set the \'currentTime\' property on \'HTMLMediaElement\': The provided double value is non-finite."'); |
- testException("video.currentTime = Infinity", '"TypeError: Failed to set the \'currentTime\' property on \'HTMLMediaElement\': The provided double value is non-finite."'); |
- testException("video.currentTime = NaN", '"TypeError: Failed to set the \'currentTime\' property on \'HTMLMediaElement\': The provided double value is non-finite."'); |
+async_test(function(t) { |
+ var video = document.querySelector("video"); |
+ |
+ video.oncanplaythrough = t.step_func_done(function () { |
+ assert_throws(new TypeError, function() { video.currentTime = -Infinity; }); |
+ assert_throws(new TypeError, function() { video.currentTime = Infinity; }); |
+ assert_throws(new TypeError, function() { video.currentTime = NaN; }); |
video.currentTime = 1.5; |
- testExpected("video.currentTime.toFixed(1)", 1.5); |
+ assert_equals(video.currentTime, 1.5); |
video.play(); |
video.currentTime = 3.1; |
- testExpected("video.currentTime.toFixed(1)", 3.1); |
- endTest(); |
+ assert_equals(video.currentTime, 3.1); |
}); |
+ |
video.src = findMediaFile("video", "content/test"); |
-</script> |
+}); |
+</script> |