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

Side by Side Diff: third_party/WebKit/LayoutTests/media/autoplay-document-move.html

Issue 2047433003: Update autoplay settings when moving media elements between documents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed layout tests 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLMediaElement.cpp » ('j') | 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>Moving media element to other document to bypass autoplay</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 function createAndMoveVideo() {
9 var v = document.implementation.createHTMLDocument().createElement('video');
10 v.src = findMediaFile('video', 'content/test');
11 document.body.appendChild(v);
12 return v;
13 }
14
15 test(function() {
16 assert_true(window.internals != null, 'This test only works with internals e xposed present');
17 }, 'internals are exposed');
18
19 async_test(function(t) {
20 window.internals.settings.setMediaPlaybackRequiresUserGesture(false);
21 var v = createAndMoveVideo();
22 assert_true(v.paused, 'Video should be paused before calling play()');
23
24 v.play().then(
25 function(e) {
mlamouri (slow - plz ping) 2016/06/09 10:57:58 v.play().then( t.step_func_done, t.step_func_d
Zhiqiang Zhang (Slow) 2016/06/09 11:20:18 Done.
26 t.done();
27 },
28 function(e) {
29 assert_unreached('Video should autoplay when gesture not required');
30 t.done();
31 });
32 }, 'Test that video should autoplay without gesture requirement');
33
34 async_test(function(t) {
35 window.internals.settings.setMediaPlaybackRequiresUserGesture(true);
36 var v = createAndMoveVideo();
37 assert_true(v.paused, 'Video should be paused before calling play()');
38
39 v.play().then(
40 function(e) {
41 assert_unreached('Video should not autoplay when gesture required');
42 t.done();
43 },
44 function(e) {
45 t.done();
46 });
mlamouri (slow - plz ping) 2016/06/09 10:57:58 ditto
Zhiqiang Zhang (Slow) 2016/06/09 11:20:18 Done.
47 }, 'Test that video should not autoplay when gesture required');
48 </script>
49 </body>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698