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

Side by Side Diff: LayoutTests/media/event-attributes.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: Fix event-attributes expectations. 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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src=media-file.js></script> 4 <script src=media-file.js></script>
5 <script src=video-test.js></script> 5 <script src=video-test.js></script>
6 <script> 6 <script>
7 var ratechangeCount = 0; 7 var ratechangeCount = 0;
8 var playingCount = 0; 8 var playingCount = 0;
9 var progressEventCount = 0; 9 var progressEventCount = 0;
10 var pauseEventCount = 0; 10 var pauseEventCount = 0;
11 11
12 function eventHandler() 12 function eventHandler()
13 { 13 {
14 // Don't log progress event since the number and order are platf orm 14 // Don't log progress event since the number and order are platf orm
15 // specific. 15 // specific.
16 if (event.type != "progress") 16 if (event.type != "progress")
17 consoleWrite("EVENT(" + event.type + ")"); 17 consoleWrite("EVENT(" + event.type + ")");
18 switch (event.type) 18 switch (event.type)
19 { 19 {
20 case "canplaythrough": 20 case "canplaythrough":
21 if (playingCount > 0)
22 return;
21 testExpected('progressEventCount', 1, '>='); 23 testExpected('progressEventCount', 1, '>=');
22 consoleWrite("<br>*** starting playback"); 24 consoleWrite("<br>*** starting playback");
23 run("video.play()"); 25 run("video.play()");
24 break; 26 break;
25 case "playing": 27 case "playing":
26 if (++playingCount == 1) { 28 if (++playingCount == 1) {
27 consoleWrite("<br>*** changing playback rate"); 29 consoleWrite("<br>*** changing playback rate");
28 run("video.playbackRate = 2"); 30 run("video.playbackRate = 2");
29 } 31 }
30 break; 32 break;
31 case "ratechange": 33 case "ratechange":
32 if (++ratechangeCount == 1) { 34 if (++ratechangeCount == 1) {
33 consoleWrite("<br>*** setting volume"); 35 consoleWrite("<br>*** setting volume");
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 onseeked="eventHandler()" 98 onseeked="eventHandler()"
97 onseeking="eventHandler()" 99 onseeking="eventHandler()"
98 onstalled="eventHandler()" 100 onstalled="eventHandler()"
99 onvolumechange="eventHandler()" 101 onvolumechange="eventHandler()"
100 onwaiting="eventHandler()" 102 onwaiting="eventHandler()"
101 > 103 >
102 </video> 104 </video>
103 105
104 </body> 106 </body>
105 </html> 107 </html>
OLDNEW
« no previous file with comments | « LayoutTests/media/controls-drag-timebar.html ('k') | LayoutTests/media/media-controls-invalid-url.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698