OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <title>autoplay clears the autoplaying flag</title> | 2 <title>autoplay clears the autoplaying flag</title> |
3 <script src="../resources/testharness.js"></script> | 3 <script src="../resources/testharness.js"></script> |
4 <script src="../resources/testharnessreport.js"></script> | 4 <script src="../resources/testharnessreport.js"></script> |
5 <script src="media-file.js"></script> | 5 <script src="media-file.js"></script> |
6 <div id="log"></div> | |
7 <script> | 6 <script> |
8 async_test(function(t) | 7 async_test(function(t) |
9 { | 8 { |
10 var a = document.createElement('audio'); | 9 var audio = document.createElement('audio'); |
11 a.src = 'data:audio/wav;base64,UklGRjQAAABXQVZFZm10IBAAAAABAAEAQB8AAIA+AAACA
BAAZGF0YRAAAAAAAAAA//8CAP3/BAD7/wQA'; | 10 audio.src = 'data:audio/wav;base64,UklGRjQAAABXQVZFZm10IBAAAAABAAEAQB8AAIA+A
AACABAAZGF0YRAAAAAAAAAA//8CAP3/BAD7/wQA'; |
12 a.autoplay = true; | 11 audio.autoplay = true; |
13 a.addEventListener('ended', function() | 12 audio.addEventListener('ended', function() |
14 { | 13 { |
15 a.currentTime = 0; | 14 audio.currentTime = 0; |
16 }); | 15 }); |
17 a.addEventListener('seeked', t.step_func(function() | 16 audio.addEventListener('seeked', t.step_func_done(function() |
18 { | 17 { |
19 assert_true(a.paused); | 18 assert_true(audio.paused); |
20 assert_true(a.readyState == a.HAVE_ENOUGH_DATA); | 19 assert_true(audio.readyState == audio.HAVE_ENOUGH_DATA); |
21 t.done(); | |
22 })); | 20 })); |
23 document.body.appendChild(a); | |
24 }); | 21 }); |
25 </script> | 22 </script> |
OLD | NEW |