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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/media/video-seek-to-middle.html

Issue 2425463002: Improve HTMLMediaElement::currentTime() (Closed)
Patch Set: Merge Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Test event dispatches and attribute changes for seek to middle.</title> 2 <title>Test event dispatches and attribute changes for seek to middle.</title>
3 <script src="../resources/testharness.js"></script> 3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script> 4 <script src="../resources/testharnessreport.js"></script>
5 <script src="../../media-resources/media-file.js"></script> 5 <script src="../../media-resources/media-file.js"></script>
6 <video></video> 6 <video></video>
7 <script> 7 <script>
8 async_test(function(t) { 8 async_test(function(t) {
9 var video = document.querySelector("video"); 9 var video = document.querySelector("video");
10 10
(...skipping 18 matching lines...) Expand all
29 })).then(t.step_func(function() { 29 })).then(t.step_func(function() {
30 testCommonAttributes(false); 30 testCommonAttributes(false);
31 return watcher.wait_for("seeked"); 31 return watcher.wait_for("seeked");
32 })).then(t.step_func_done(function() { 32 })).then(t.step_func_done(function() {
33 testCommonAttributes(false); 33 testCommonAttributes(false);
34 })); 34 }));
35 35
36 function testCommonAttributes(seekingExpected) { 36 function testCommonAttributes(seekingExpected) {
37 assert_equals(video.seeking, seekingExpected); 37 assert_equals(video.seeking, seekingExpected);
38 assert_false(video.ended); 38 assert_false(video.ended);
39 assert_equals(video.currentTime, video.duration / 2); 39 if (seekingExpected) {
40 assert_equals(video.currentTime, video.duration / 2);
41 } else {
42 // If seek has completed, the currentTime may have advanced slightly
43 // beyond the initial seek point since the video is not paused.
44 assert_greater_than_equal(video.currentTime, video.duration / 2);
45 }
40 assert_false(video.paused); 46 assert_false(video.paused);
41 } 47 }
42 48
43 video.src = findMediaFile("video", "resources/test"); 49 video.src = findMediaFile("video", "resources/test");
44 video.play(); 50 video.play();
45 }); 51 });
46 </script> 52 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698