OLD | NEW |
---|---|
1 <html> | 1 <!DOCTYPE HTML> |
2 <head> | 2 <title>Test that a 'play' event is fired by a new audio element on playing.</tit le> |
3 <title>'play' event</title> | 3 <script src="media-file.js"></script> |
4 <script src=media-file.js></script> | 4 <script src="../resources/testharness.js"></script> |
5 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 | 5 <script src="../resources/testharnessreport.js"></script> |
6 (Please avoid writing new tests using video-test.js) --> | 6 <script> |
7 <script src=video-test.js></script> | 7 async_test(function(t) { |
8 | 8 var audio = new Audio(); |
9 <script> | 9 audio.onplay = t.step_func_done(); |
Srirama
2016/05/26 15:09:50
Should we test playing event as well? Based on the
fs
2016/05/26 15:35:00
Can't say that I fully understand the reasoning be
Srirama
2016/05/26 17:27:51
Done.
| |
10 function start() | 10 audio.src = findMediaFile('audio', 'content/test'); |
11 { | 11 audio.play(); |
12 mediaElement = new Audio(); | 12 }); |
13 waitForEvent('error'); | 13 </script> |
14 waitForEvent('loadedmetadata'); | |
15 waitForEvent('canplay'); | |
16 waitForEvent('play'); | |
17 waitForEvent('playing', function() { endTest(); }); | |
18 run("mediaElement.src = findMediaFile('audio', 'content/test')") ; | |
19 run("mediaElement.volume = 1"); | |
20 run("mediaElement.play()"); | |
21 } | |
22 </script> | |
23 </head> | |
24 | |
25 <body onload="start()"> | |
26 <p>Test that a 'play' event listener is triggered when fired by a new audio element.</p> | |
27 </body> | |
28 </html> | |
OLD | NEW |