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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/webaudio/resources/autoplay-crossorigin-iframe.html

Issue 2389963002: Move setMediaPlaybackRequiresUserGesture to the cross-origin frame. (Closed)
Patch Set: Created 4 years, 2 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 | « third_party/WebKit/LayoutTests/http/tests/webaudio/autoplay-crossorigin.html ('k') | 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <body><span>click me</span></body> 2 <body><span>click me</span></body>
3 <script> 3 <script>
4 if ('internals' in window)
5 window.internals.settings.setMediaPlaybackRequiresUserGesture(true);
6
4 function synthesizeClick(callback) { 7 function synthesizeClick(callback) {
5 document.onclick = callback; 8 document.onclick = callback;
6 window.parent.postMessage({ msg: 'clickme' }, '*'); 9 window.parent.postMessage({ msg: 'clickme' }, '*');
7 } 10 }
8 11
9 // AudioContext will start as suspended when lacking a user gesture. 12 // AudioContext will start as suspended when lacking a user gesture.
10 var audioContext = new AudioContext(); 13 var audioContext = new AudioContext();
11 window.parent.postMessage({ msg: 'initialState', value: audioContext.state }, 14 window.parent.postMessage({ msg: 'initialState', value: audioContext.state },
12 '*'); 15 '*');
13 16
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // Creating an AudioContext from a click event will start it. 59 // Creating an AudioContext from a click event will start it.
57 var lastAudioContext = new AudioContext(); 60 var lastAudioContext = new AudioContext();
58 window.parent.postMessage({ msg: 'stateCreatedAfterClick', 61 window.parent.postMessage({ msg: 'stateCreatedAfterClick',
59 value: lastAudioContext.state }, '*'); 62 value: lastAudioContext.state }, '*');
60 63
61 window.parent.postMessage({ msg: 'done' }, '*'); 64 window.parent.postMessage({ msg: 'done' }, '*');
62 }); 65 });
63 }); 66 });
64 }); 67 });
65 </script> 68 </script>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/webaudio/autoplay-crossorigin.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698