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

Side by Side Diff: third_party/WebKit/LayoutTests/media/autoplay-from-mediastream-to-src.html

Issue 2075563003: [Android, Media] Don't unlock MediaStream elements; instead allow MS to autoplay without a gesture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>Test for autoplay of video once the media stream is set to null</title>
3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script>
5 <script src="media-file.js"></script>
6 <script>
7 test(function() {
8 assert_true(!!window.internals && !!window.internals.settings,
9 "This test only works when run as a layout test!");
10 }, "Prerequisites to running the rest of the tests");
11
12 window.internals.settings.setMediaPlaybackRequiresUserGesture(true);
13
14 async_test(function(t) {
15 var v = document.createElement('video');
16 // getUserMedia works with autoplay video elements, play() is
17 // blocked.
18 v.autoplay = true;
19
20 v.onplaying = function() {
21 assert_false(v.paused);
22
23 v.onplaying = null;
24 v.srcObject = null;
25
26 // Once the source has changed to anything but MediaStream, the
27 // video must not be able to play.
28 v.src = findMediaFile('video', 'content/test');
29 v.play()
30 .then(t.unreached_func('The video must not play without user ges ture.'))
31 .catch(t.step_func_done(function() {
32 assert_true(v.paused);
33 }));
34 };
35
36 navigator.webkitGetUserMedia(
37 { video : true },
38 t.step_func(function(s) {
39 v.srcObject = s;
40 }),
41 t.unreached_func('Can not get MediaStream object.'));
42 }, 'Test that switching from MediaStream to src= does not autoplay.');
43
44 </script>
45
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698