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

Unified Diff: third_party/WebKit/LayoutTests/media/video-buffered-unknown-duration.html

Issue 2060353005: Convert video-autoplay*, video-black* and video-buffered* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address nit 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-buffered-unknown-duration.html
diff --git a/third_party/WebKit/LayoutTests/media/video-buffered-unknown-duration.html b/third_party/WebKit/LayoutTests/media/video-buffered-unknown-duration.html
index 7de11ae8e6ed2b00904e98eefdee6c95a956f347..8271244f8b2b1779288105cd8978e7df7064d289 100644
--- a/third_party/WebKit/LayoutTests/media/video-buffered-unknown-duration.html
+++ b/third_party/WebKit/LayoutTests/media/video-buffered-unknown-duration.html
@@ -1,40 +1,37 @@
<!DOCTYPE html>
-<html>
-<body onload="start()">
-<p>Load a video with an infinite duration. Start playback and ensure
-video.currentTime &lt; video.buffered.end(0) upon first timeupdate.</p>
-<video></video>
-<!-- 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>
+<title>Load a video with an infinite duration. Start playback and ensure video.currentTime is less than video.buffered.end(0) upon first timeupdate.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
<script src="media-file.js"></script>
+<video></video>
<script>
- waitForEventOnce('timeupdate', function() {
+async_test(function(t) {
+ var video = document.querySelector("video");
+
+ video.ontimeupdate = t.step_func_done(function() {
+ video.ontimeupdate = null;
video.pause();
- testExpected('video.duration', Infinity, '==');
- testExpected('video.buffered.start(0)', 0, '>=');
+ assert_equals(video.duration, Infinity);
+ assert_greater_than_equal(video.buffered.start(0), 0);
// 10 seconds chosen arbitrarily as it's larger than the duration, but
// small enough to test for overflow of arithmetic performed on the
// infinite duration.
- testExpected('video.buffered.end(0)', 10, '<');
- test('video.currentTime <= video.buffered.end(0)');
- endTest();
+ assert_less_than(video.buffered.end(0), 10);
+ assert_less_than_equal(video.currentTime, video.buffered.end(0));
});
- waitForEventOnce('loadeddata', function() {
- testExpected('video.buffered.length', 1, '==');
- testExpected('video.buffered.start(0)', 0, '>=');
- testExpected('video.buffered.end(0)', Infinity, '!=');
- testExpected('video.currentTime', 0, '==');
- testExpected('video.duration', Infinity, '==');
+ video.onloadeddata = t.step_func(function() {
+ video.onloadeddata = null;
+ assert_equals(video.buffered.length, 1);
+ assert_greater_than_equal(video.buffered.start(0), 0);
+ assert_not_equals(video.buffered.end(0), Infinity);
+ assert_equals(video.currentTime, 0);
+ assert_equals(video.duration, Infinity);
video.play();
});
- function start() {
- video.src = 'resources/test-live.webm';
- }
-</script>
-</body>
-</html>
+ video.src = "resources/test-live.webm";
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698