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

Side by Side Diff: LayoutTests/media/video-seeking.html

Issue 17395006: Fix LayoutTests that assume canplay, playing, and canplaythrough will only fire once. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
1 <video controls></video> 1 <video controls></video>
2 <p>Test that seeking attribute is true immediately after a seek, 2 <p>Test that seeking attribute is true immediately after a seek,
3 goes back to false when seeking completes, and that a 'seeked' event 3 goes back to false when seeking completes, and that a 'seeked' event
4 is fired for each seek 4 is fired for each seek
5 </p> 5 </p>
6 <script src=media-file.js></script> 6 <script src=media-file.js></script>
7 <script src=video-test.js></script> 7 <script src=video-test.js></script>
8 <script> 8 <script>
9 9
10 var seekedCount = 0; 10 var seekedCount = 0;
11 11
12 function seeked() 12 function seeked()
13 { 13 {
14 ++seekedCount; 14 ++seekedCount;
15 consoleWrite(""); 15 consoleWrite("");
16 16
17 testExpected("video.seeking", false); 17 testExpected("video.seeking", false);
18 testExpected("video.currentTime", seekedCount * 0.5); 18 testExpected("video.currentTime", seekedCount * 0.5);
19
20 if (seekedCount == 3) {
21 endTest();
22 return;
23 }
24
19 run("video.currentTime = " + (seekedCount + 1) * 0.5); 25 run("video.currentTime = " + (seekedCount + 1) * 0.5);
20 testExpected("video.seeking", true); 26 testExpected("video.seeking", true);
21 27
22 consoleWrite(""); 28 consoleWrite("");
23 29
24 if (seekedCount == 3)
25 endTest();
26 } 30 }
27 31
28 function canplaythrough() 32 function canplaythrough()
29 { 33 {
34 if (seekedCount > 0)
35 return;
36
30 run("video.currentTime = 0.5"); 37 run("video.currentTime = 0.5");
31 consoleWrite(""); 38 consoleWrite("");
32 } 39 }
33 40
34 waitForEvent('waiting' ); 41 waitForEvent('waiting' );
35 waitForEvent('seeked', seeked ); 42 waitForEvent('seeked', seeked );
36 waitForEvent('canplaythrough', canplaythrough); 43 waitForEventOnce('canplaythrough', canplaythrough);
37 44
38 video.src = findMediaFile("video", "content/test"); 45 video.src = findMediaFile("video", "content/test");
39 </script> 46 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698