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

Unified Diff: LayoutTests/media/video-double-seek-currentTime.html

Issue 235953010: Resolve the issue of unexpected currentTime values when setting currentTime from seeking event (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@mediaposter
Patch Set: Added new line in the expected output to match the test case Created 6 years, 8 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
« no previous file with comments | « no previous file | LayoutTests/media/video-double-seek-currentTime-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/media/video-double-seek-currentTime.html
diff --git a/LayoutTests/media/video-double-seek-currentTime.html b/LayoutTests/media/video-double-seek-currentTime.html
new file mode 100644
index 0000000000000000000000000000000000000000..028352db94b4b8fcfd2404135340de0f07daebf3
--- /dev/null
+++ b/LayoutTests/media/video-double-seek-currentTime.html
@@ -0,0 +1,82 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <script src=media-file.js></script>
+ <script src=video-test.js></script>
+ <script>
+ var seekCount = 0;
+ var expectedSeek = 0;
+ var video;
+
+ function seeking(e)
+ {
+ consoleWrite("seeking " + e.target.currentTime.toFixed(2));
+
+ doNextSeek(e.target);
+ }
+
+ function seeked(e)
+ {
+ consoleWrite("seeked " + e.target.currentTime.toFixed(2));
+
+ video = e.target;
+ var now = e.target.currentTime.toFixed(2);
+ var expected = expectedSeek.toFixed(2);
+ if (now != expected) {
+ failTest("Expected " + expectedSeek + " got " + now);
+ return;
+ }
+ endTest();
+ }
+
+ function doNextSeek(video)
+ {
+ consoleWrite("doNextSeek() " + seekCount);
+
+ var newSeekPoint = -1;
+ switch (seekCount) {
+ case 0:
+ newSeekPoint = 1;
+ break;
+ case 1:
+ newSeekPoint = 1.5;
+ break;
+ case 2:
+ newSeekPoint = 1.5;
+ break;
+ };
+
+ if (newSeekPoint >= 0) {
+ consoleWrite('doNextSeek() seeking to ' + newSeekPoint.toFixed(2));
+ expectedSeek = newSeekPoint;
+ video.currentTime = newSeekPoint;
+ }
+ seekCount++;
+ }
+
+ function loadedmetadata(e)
+ {
+ consoleWrite("loadedmetadata()");
+ doNextSeek(e.target);
+ }
+
+ function onWindowLoad(e)
+ {
+ video = document.getElementById('video');
+
+ video.src = findMediaFile("video", "content/test");
+ video.addEventListener('seeking', seeking);
+ video.addEventListener('seeked', seeked);
+ video.addEventListener('loadedmetadata', loadedmetadata);
+ video.load();
+ }
+
+ window.addEventListener('load', onWindowLoad, false);
+ </script>
+ </head>
+ <body>
+ <video controls id="video"></video>
+ <p>Test currentTime values when setting from seeking event.</p>
+ <br/>
+ </body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/media/video-double-seek-currentTime-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698