| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>Verify that autoplaying Web Audio from a cross origin iframe is blocked b
y mediaPlaybackRequiresUserGesture</title> | 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> | 3 <script src='../resources/testharness.js'></script> |
| 4 <script src='../resources/testharnessreport.js'></script> | 4 <script src='../resources/testharnessreport.js'></script> |
| 5 <body></body> | 5 <body></body> |
| 6 <script> | 6 <script> |
| 7 async_test(t => { | 7 async_test(t => { |
| 8 if ('internals' in window) | |
| 9 window.internals.settings.setMediaPlaybackRequiresUserGesture(true); | |
| 10 | |
| 11 window.addEventListener('message', e => { | 8 window.addEventListener('message', e => { |
| 12 switch (e.data.msg) { | 9 switch (e.data.msg) { |
| 13 case 'clickme': | 10 case 'clickme': |
| 14 if (!('eventSender' in window)) | 11 if (!('eventSender' in window)) |
| 15 return; | 12 return; |
| 16 | 13 |
| 17 var boundingRect = document.querySelector('iframe').getBoundingClientRec
t(); | 14 var boundingRect = document.querySelector('iframe').getBoundingClientRec
t(); |
| 18 var x = boundingRect.left + boundingRect.width / 2; | 15 var x = boundingRect.left + boundingRect.width / 2; |
| 19 var y = boundingRect.top + boundingRect.height / 2; | 16 var y = boundingRect.top + boundingRect.height / 2; |
| 20 | 17 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 40 default: | 37 default: |
| 41 assert_unreached(); | 38 assert_unreached(); |
| 42 } | 39 } |
| 43 }); | 40 }); |
| 44 | 41 |
| 45 var f = document.createElement('iframe'); | 42 var f = document.createElement('iframe'); |
| 46 f.src = 'http://localhost:8000/webaudio/resources/autoplay-crossorigin-iframe.
html'; | 43 f.src = 'http://localhost:8000/webaudio/resources/autoplay-crossorigin-iframe.
html'; |
| 47 document.body.appendChild(f); | 44 document.body.appendChild(f); |
| 48 }); | 45 }); |
| 49 </script> | 46 </script> |
| OLD | NEW |