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

Side by Side Diff: third_party/WebKit/LayoutTests/media/autoplay-never-visible.html

Issue 2251463002: Adding test to avoid memory leak when autoplayed video never become visible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding test to avoid memory leak when autoplayed video never become visible Created 4 years, 4 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>Test behaviour of autoplay muted videos with regards to visibility</title >
3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script>
5 <script src="media-file.js"></script>
6 <body>
7 <script>
8 window.internals.settings.setMediaPlaybackRequiresUserGesture(true);
9 window.internals.runtimeFlags.autoplayMutedVideosEnabled = true;
10
11 async_test(function(t) {
12 // Create a video off screen.
13 {
14 var video = document.createElement('video');
15 video.id = 'offscreen';
16 video.src = findMediaFile('video', 'content/test');
17 video.muted = true;
18 video.autoplay = true;
19 video.loop = true;
20 video.style.position = 'absolute';
21 video.style.top = '-10000px';
22 document.body.appendChild(video);
23 }
24
25 var offscreen = document.querySelector('#offscreen');
26
27 offscreen.addEventListener('canplay', t.step_func_done(function() {
28 // The offscreen videos shouldn't play.
29 assert_true(offscreen.paused);
30 assert_greater_than_equal(offscreen.readyState, HTMLMediaElement.HAVE_ENOU GH_DATA);
31 }));
32 }, "Test that muted video with an autoplay attribute does not leak if it's nev er visible");
33 </script>
34 </body>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698