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

Unified Diff: LayoutTests/media/video-seek-to-duration-with-playbackrate-zero.html

Issue 331063006: Fix HTMLMediaElement "direction of playback" behavior. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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: LayoutTests/media/video-seek-to-duration-with-playbackrate-zero.html
diff --git a/LayoutTests/media/video-seek-to-duration-with-playbackrate-zero.html b/LayoutTests/media/video-seek-to-duration-with-playbackrate-zero.html
new file mode 100644
index 0000000000000000000000000000000000000000..4c907b6595c618c21ed869528e60f9341da2748e
--- /dev/null
+++ b/LayoutTests/media/video-seek-to-duration-with-playbackrate-zero.html
@@ -0,0 +1,58 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Test behavior when seeking to the duration and the playback rate equals 0.</title>
+ <script src="media-file.js"></script>
+ <script src="video-test.js"></script>
+
+ <script>
+ function onLoad()
+ {
+ findMediaElement();
+ video.src = findMediaFile("video", "content/test");
+ video.load();
+ waitForEvent("seeking");
+
+ waitForEventOnce("loadedmetadata", function()
+ {
+ consoleWrite("Seeking to duration");
+ video.currentTime = video.duration;
+ video.playbackRate = 0;
+ waitForEventOnce("seeked");
+ waitForEventOnce("ended", firstEnded);
+ });
+
+ function firstEnded()
+ {
+ testExpected("video.currentTime == video.duration", true);
+ consoleWrite("Seeking to the middle of the video");
+ video.currentTime = video.duration / 2;
+ waitForEventOnce("seeked", seekToMiddleDone);
+ }
+
+ function seekToMiddleDone()
+ {
+ consoleWrite("Setting loop to true and seeking to duration.");
+ video.loop = true;
+ video.currentTime = video.duration;
+ waitForEventOnce("seeked", seekToDurationComplete);
+ }
+
+ function seekToDurationComplete()
+ {
+ consoleWrite("Seek to duration completed. Waiting for a seek to the beginning.");
+ waitForEventOnce("seeked", seekToBeginningComplete);
+ }
+
+ function seekToBeginningComplete()
+ {
+ testExpected("video.currentTime", 0);
+ endTest();
+ }
+ }
+ </script>
+ </head>
+ <body onload="onLoad()">
+ <video id="v" preload="metadata"></video>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698