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

Side by Side Diff: LayoutTests/media/autoplay-with-preload-none.html

Issue 313963004: Don't delay loading if autoplay is set and preload equals 'none'. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | LayoutTests/media/autoplay-with-preload-none-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <!-- original: https://github.com/w3c/web-platform-tests/blob/6b3893bb99f70e4238 011dbcd1f380891e89ec5e/html/semantics/embedded-content-0/media-elements/autoplay .html --> 2 <title>autoplay with preload set to none.</title>
3 <title>autoplay</title>
4 <script src="../resources/testharness.js"></script> 3 <script src="../resources/testharness.js"></script>
5 <script src="../resources/testharnessreport.js"></script> 4 <script src="../resources/testharnessreport.js"></script>
6 <script src="media-file.js"></script> 5 <script src="media-file.js"></script>
7 <div id="log"></div> 6 <div id="log"></div>
8 <script> 7 <script>
9 function autoplay_test(tagName, src) 8 function autoplay_test(tagName, src)
10 { 9 {
11 async_test(function(t) 10 async_test(function(t)
12 { 11 {
13 var e = document.createElement(tagName); 12 var e = document.createElement(tagName);
14 e.src = src; 13 e.src = src;
14 e.preload = "none";
15 e.autoplay = true; 15 e.autoplay = true;
16 var actual_events = []; 16 var actual_events = [];
17 var expected_events = ['canplay', 'play', 'playing', 'canplaythrough']; 17 var expected_events = ['canplay', 'play', 'playing', 'canplaythrough'];
18 expected_events.forEach(function(type) 18 expected_events.forEach(function(type)
19 { 19 {
20 e.addEventListener(type, t.step_func(function() 20 e.addEventListener(type, t.step_func(function()
21 { 21 {
22 assert_equals(e.readyState, e.HAVE_ENOUGH_DATA); 22 assert_equals(e.readyState, e.HAVE_ENOUGH_DATA);
23 assert_false(e.paused); 23 assert_false(e.paused);
24 actual_events.push(type); 24 actual_events.push(type);
25 if (type == 'canplaythrough') { 25 if (type == 'canplaythrough') {
26 assert_array_equals(actual_events, expected_events); 26 assert_array_equals(actual_events, expected_events);
27 t.done(); 27 t.done();
28 } 28 }
29 })); 29 }));
30 }); 30 });
31 }, tagName + '.autoplay'); 31 }, tagName + '.autoplay with preload="none"');
32 } 32 }
33 33
34 autoplay_test('audio', findMediaFile('audio', 'content/test')); 34 autoplay_test('audio', findMediaFile('audio', 'content/test'));
35 autoplay_test('video', findMediaFile('video', 'content/test')); 35 autoplay_test('video', findMediaFile('video', 'content/test'));
36 </script> 36 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/media/autoplay-with-preload-none-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698