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

Side by Side 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 unified diff | Download patch
OLDNEW
1 <html> 1 <!DOCTYPE html>
2 <body> 2 <title>Test, a delay in playing the movie still results in an "ended" event.</ti tle>
3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script>
5 <script src="media-file.js"></script>
6 <video></video>
7 <script>
8 async_test(function(t) {
9 var video = document.querySelector("video");
3 10
4 <video controls></video> 11 video.oncanplaythrough = t.step_func(function() {
5 12 video.oncanplaythrough = null;
6 <p>Test a delay in playing the movie results in a canPlay event.</p> 13 assert_equals(video.currentTime, 0);
7 14 video.currentTime = video.duration - 0.2;
8 <script src=media-file.js></script>
9 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
10 (Please avoid writing new tests using video-test.js) -->
11 <script src=video-test.js></script>
12 <script>
13 waitForEventOnce('canplaythrough',
14 function () {
15 waitForEventAndEnd('ended');
16
17 testExpected("video.currentTime", 0);
18 run("video.currentTime = video.duration - 0.2");
19 }); 15 });
20 16
21 waitForEvent('seeked', 17 video.onseeked = t.step_func(function () {
22 function () {
23 setTimeout(function() { 18 setTimeout(function() {
24 run("video.play()"); 19 video.play();
25 }, 400); 20 }, 400);
26 }); 21 });
27 22
23 video.onended = t.step_func_done();
28 video.src = findMediaFile("video", "content/test"); 24 video.src = findMediaFile("video", "content/test");
29 </script> 25 });
30 26 </script>
31 </body>
32 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698