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

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

Issue 2071303002: Convert video-currentTime-delay* and video-currentTime-before* 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-delay.html
diff --git a/third_party/WebKit/LayoutTests/media/video-currentTime-delay.html b/third_party/WebKit/LayoutTests/media/video-currentTime-delay.html
index 2307eec17d3095c06e5221f23cf8437c21b0a9a7..be0fff4f8dfd8a65ae176515da8c31452208a322 100644
--- a/third_party/WebKit/LayoutTests/media/video-currentTime-delay.html
+++ b/third_party/WebKit/LayoutTests/media/video-currentTime-delay.html
@@ -1,32 +1,26 @@
-<html>
-<body>
+<!DOCTYPE html>
+<title>Test, a delay in playing the movie still results in an "ended" event.</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 controls></video>
-
- <p>Test a delay in playing the movie results in a canPlay event.</p>
-
- <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>
- waitForEventOnce('canplaythrough',
- function () {
- waitForEventAndEnd('ended');
-
- testExpected("video.currentTime", 0);
- run("video.currentTime = video.duration - 0.2");
+ video.oncanplaythrough = t.step_func(function() {
+ video.oncanplaythrough = null;
+ assert_equals(video.currentTime, 0);
+ video.currentTime = video.duration - 0.2;
});
- waitForEvent('seeked',
- function () {
+ video.onseeked = t.step_func(function () {
setTimeout(function() {
- run("video.play()");
+ video.play();
}, 400);
});
+ video.onended = t.step_func_done();
video.src = findMediaFile("video", "content/test");
- </script>
-
-</body>
-</html>
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698