OLD | NEW |
---|---|
(Empty) | |
1 <!doctype html> | |
2 <title>autoplay</title> | |
3 <script src="../resources/testharness.js"></script> | |
4 <script src="../resources/testharnessreport.js"></script> | |
5 <script src="media-file.js"></script> | |
6 <div id="log"></div> | |
7 <script> | |
8 function autoplay_test(tagName, src) { | |
acolwell GONE FROM CHROMIUM
2014/02/18 18:30:37
nit: 4-space indent here and everywhere else in th
philipj_slow
2014/02/19 03:10:05
I thought it was best to minimize the changes to t
| |
9 async_test(function(t) { | |
10 var e = document.createElement(tagName); | |
11 e.src = src; | |
12 e.autoplay = true; | |
13 var actual_events = []; | |
14 var expected_events = ['canplay', 'play', 'playing', 'canplaythrough']; | |
15 expected_events.forEach(function(type) { | |
acolwell GONE FROM CHROMIUM
2014/02/18 18:30:37
nit: { on next line here and below to match Blink
| |
16 e.addEventListener(type, t.step_func(function() { | |
17 assert_equals(e.readyState, e.HAVE_ENOUGH_DATA); | |
18 assert_false(e.paused); | |
19 actual_events.push(type); | |
20 if (type == 'canplaythrough') { | |
21 assert_array_equals(actual_events, expected_events); | |
22 t.done(); | |
23 } | |
24 })); | |
25 }); | |
26 }, tagName + '.autoplay'); | |
27 } | |
28 | |
29 autoplay_test('audio', findMediaFile('audio', 'content/test')); | |
30 autoplay_test('video', findMediaFile('video', 'content/test')); | |
31 </script> | |
OLD | NEW |