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

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

Issue 552303006: Prevent more script-observable cases of HTMLMediaElement GC (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: make gc-while-seeking.html non-flaky Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/media/autoplay.html ('k') | LayoutTests/media/avtrack/addtrack.html » ('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 <title>autoplay with preload set to none.</title> 2 <title>autoplay with preload set to none.</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> 6 <div id="log"></div>
7 <script> 7 <script>
8 function autoplay_test(tagName, src) 8 function autoplay_test(tagName, src)
9 { 9 {
10 async_test(function(t) 10 async_test(function(t)
11 { 11 {
12 var e = document.createElement(tagName); 12 var e = document.createElement(tagName);
13 // add to body to prevent GC pending http://crbug.com/400659
14 document.body.appendChild(e);
15 e.src = src; 13 e.src = src;
16 e.preload = "none"; 14 e.preload = "none";
17 e.autoplay = true; 15 e.autoplay = true;
18 var actual_events = []; 16 var actual_events = [];
19 var expected_events = ['canplay', 'play', 'playing', 'canplaythrough']; 17 var expected_events = ['canplay', 'play', 'playing', 'canplaythrough'];
20 expected_events.forEach(function(type) 18 expected_events.forEach(function(type)
21 { 19 {
22 e.addEventListener(type, t.step_func(function() 20 e.addEventListener(type, t.step_func(function()
23 { 21 {
24 assert_equals(e.readyState, e.HAVE_ENOUGH_DATA); 22 assert_equals(e.readyState, e.HAVE_ENOUGH_DATA);
25 assert_false(e.paused); 23 assert_false(e.paused);
26 actual_events.push(type); 24 actual_events.push(type);
27 if (type == 'canplaythrough') { 25 if (type == 'canplaythrough') {
28 assert_array_equals(actual_events, expected_events); 26 assert_array_equals(actual_events, expected_events);
29 t.done(); 27 t.done();
30 } 28 }
31 })); 29 }));
32 }); 30 });
33 }, tagName + '.autoplay with preload="none"'); 31 }, tagName + '.autoplay with preload="none"');
34 } 32 }
35 33
36 autoplay_test('audio', findMediaFile('audio', 'content/test')); 34 autoplay_test('audio', findMediaFile('audio', 'content/test'));
37 autoplay_test('video', findMediaFile('video', 'content/test')); 35 autoplay_test('video', findMediaFile('video', 'content/test'));
38 </script> 36 </script>
OLDNEW
« no previous file with comments | « LayoutTests/media/autoplay.html ('k') | LayoutTests/media/avtrack/addtrack.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698