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

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

Issue 2314903002: Web Audio: when media playback requires a user gesture, apply rule to cross origin iframes. (Closed)
Patch Set: move click simulation to top frame 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 | « no previous file | third_party/WebKit/LayoutTests/http/tests/webaudio/resources/autoplay-crossorigin-iframe.html » ('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>Verify that autoplaying Web Audio from a cross origin iframe is blocked b y mediaPlaybackRequiresUserGesture</title>
3 <script src='../resources/testharness.js'></script>
4 <script src='../resources/testharnessreport.js'></script>
5 <body></body>
6 <script>
7 async_test(t => {
8 if ('internals' in window)
9 window.internals.settings.setMediaPlaybackRequiresUserGesture(true);
10
11 window.addEventListener('message', e => {
12 switch (e.data.msg) {
13 case 'clickme':
14 if (!('eventSender' in window))
15 return;
16
17 var boundingRect = document.querySelector('iframe').getBoundingClientRec t();
18 var x = boundingRect.left + boundingRect.width / 2;
19 var y = boundingRect.top + boundingRect.height / 2;
20
21 eventSender.mouseMoveTo(x, y);
22 eventSender.mouseDown();
23 eventSender.mouseUp();
24 break;
25 case 'initialState':
26 case 'initialOfflineState':
27 case 'afterResume':
28 case 'afterOscillator':
29 case 'stateOtherContextAfterClick':
30 case 'stateOtherContextAfterSecondClick':
31 assert_equals(e.data.value, 'suspended', e.data.msg);
32 break;
33 case 'stateAfterClick':
34 case 'stateCreatedAfterClick':
35 assert_equals(e.data.value, 'running', e.data.msg);
36 break;
37 case 'done':
38 t.done();
39 break;
40 default:
41 assert_unreached();
42 }
43 });
44
45 var f = document.createElement('iframe');
46 f.src = 'http://localhost:8000/webaudio/resources/autoplay-crossorigin-iframe. html';
47 document.body.appendChild(f);
48 });
49 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/webaudio/resources/autoplay-crossorigin-iframe.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698