Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / media / autoplay.html
blobca59be325e0c3c18f55759b24e6354649e8b6360
1 <!doctype html>
2 <!-- original: https://github.com/w3c/web-platform-tests/blob/6b3893bb99f70e4238011dbcd1f380891e89ec5e/html/semantics/embedded-content-0/media-elements/autoplay.html -->
3 <title>autoplay</title>
4 <script src="../resources/testharness.js"></script>
5 <script src="../resources/testharnessreport.js"></script>
6 <script src="media-file.js"></script>
7 <div id="log"></div>
8 <script>
9 function autoplay_test(tagName, src)
11 async_test(function(t)
13 var e = document.createElement(tagName);
14 e.src = src;
15 e.autoplay = true;
16 var actual_events = [];
17 var expected_events = ['canplay', 'play', 'playing', 'canplaythrough'];
18 expected_events.forEach(function(type)
20 e.addEventListener(type, t.step_func(function()
22 assert_equals(e.readyState, e.HAVE_ENOUGH_DATA);
23 assert_false(e.paused);
24 actual_events.push(type);
25 if (type == 'canplaythrough') {
26 assert_array_equals(actual_events, expected_events);
27 t.done();
29 }));
30 });
31 }, tagName + '.autoplay');
34 autoplay_test('audio', findMediaFile('audio', 'content/test'));
35 autoplay_test('video', findMediaFile('video', 'content/test'));
36 </script>