Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: third_party/WebKit/LayoutTests/media/video-currentTime-set2.html

Issue 2077833002: Convert video-currentTime* tests to testharness.js. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698