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

Side by Side Diff: LayoutTests/media/audio-concurrent-supported.html

Issue 574883002: Fix media layout tests that made invalid assumptions about timeupdate. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase + fix Created 6 years, 3 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
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/media/audio-concurrent-supported-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <title>Test of concurrent HTML5 audio</title> 2 <title>Test of concurrent HTML5 audio</title>
3 <body> 3 <body>
4 4
5 <p>Test that multiple audio elements can play concurrently.</p> 5 <p>Test that multiple audio elements can play concurrently.</p>
6 6
7 <script src=video-test.js></script> 7 <script src=video-test.js></script>
8 <script src=media-file.js></script> 8 <script src=media-file.js></script>
9 <script> 9 <script>
10 var maxPlayers = 2; // Number of concurrent audio elements to test. For larger values a longer media file is needed. 10 var maxPlayers = 2; // Number of concurrent audio elements to test. For larger values a longer media file is needed.
(...skipping 14 matching lines...) Expand all
25 this.play(); 25 this.play();
26 } 26 }
27 27
28 function playingListener(event) 28 function playingListener(event)
29 { 29 {
30 consoleWrite("EVENT(" + audioElementCount + ", playing)"); 30 consoleWrite("EVENT(" + audioElementCount + ", playing)");
31 } 31 }
32 32
33 function timeupdateListener(event) 33 function timeupdateListener(event)
34 { 34 {
35 ++timeupdateEventCount; 35 // Make sure time is advancing.
36 36 if (this.currentTime > 0) {
37 // wait 2 timeupdate events so we are sure the media engine is
38 // playing the media.
39 if (timeupdateEventCount >= 2) {
40 // make sure time is advancing
41 testElement = this;
42 testExpected(audioElementCount + ", testElement.currentTime", 0, '>');
43 this.removeEventListener('timeupdate', timeupdateListener); 37 this.removeEventListener('timeupdate', timeupdateListener);
44 if (++audioElementCount >= maxPlayers) { 38 if (++audioElementCount >= maxPlayers) {
45 // All audio elements have been started playing. Make sure 39 // All audio elements have been started playing. Make sure
46 // all of them are still playing. 40 // all of them are still playing.
47 consoleWrite("Making sure all " + maxPlayers + " audio eleme nts are in playing state:"); 41 consoleWrite("Making sure all " + maxPlayers + " audio eleme nts are in playing state:");
48 for (var i = 0; i < maxPlayers; i++) { 42 for (var i = 0; i < maxPlayers; i++) {
49 testElement = document.getElementsByTagName('audio')[i]; 43 testElement = document.getElementsByTagName('audio')[i];
50 testExpected(i + ", testElement.paused", false); 44 testExpected(i + ", testElement.paused", false);
51 } 45 }
52 endTest(); 46 endTest();
(...skipping 17 matching lines...) Expand all
70 64
71 consoleWrite("Starting a total of " + maxPlayers + " concurrent audio el ements."); 65 consoleWrite("Starting a total of " + maxPlayers + " concurrent audio el ements.");
72 for (var i = 0; i < maxPlayers; i++) 66 for (var i = 0; i < maxPlayers; i++)
73 document.write("<audio controls></audio>"); 67 document.write("<audio controls></audio>");
74 68
75 testAudioElement(0); 69 testAudioElement(0);
76 </script> 70 </script>
77 71
78 </body> 72 </body>
79 </html> 73 </html>
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/media/audio-concurrent-supported-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698