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

Side by Side Diff: third_party/WebKit/LayoutTests/media/audio-play-event.html

Issue 2009993003: Convert audio-data*, audio-garbage* and audio-play* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed eventcount 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 <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(function() {});
10 function start() 10 audio.onloadedmetadata = t.step_func(function() {});
11 { 11 audio.oncanplay = t.step_func(function() {});
12 mediaElement = new Audio(); 12 audio.onplaying = t.step_func_done();
13 waitForEvent('error'); 13 audio.onerror = t.unreached_func("Should not fire 'error' event");
14 waitForEvent('loadedmetadata'); 14 audio.src = findMediaFile("audio", "content/test");
15 waitForEvent('canplay'); 15 audio.play();
16 waitForEvent('play'); 16 });
17 waitForEvent('playing', function() { endTest(); }); 17 </script>
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698