| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Unique origin is unable to create MediaKeys</title> | 4 <title>Unique origin is unable to create MediaKeys</title> |
| 5 <script src="../../resources/testharness.js"></script> | 5 <script src="../../resources/testharness.js"></script> |
| 6 <script src="../../resources/testharnessreport.js"></script> | 6 <script src="../../resources/testharnessreport.js"></script> |
| 7 </head> | 7 </head> |
| 8 <body> | 8 <body> |
| 9 <div id="log"></div> | |
| 10 <script> | 9 <script> |
| 11 // When the sandbox attribute is present on an iframe, it will | 10 // When the sandbox attribute is present on an iframe, it will |
| 12 // treat the content as being from a unique origin. So try to | 11 // treat the content as being from a unique origin. So try to |
| 13 // call createMediaKeys() inside an iframe and it should fail. | 12 // call createMediaKeys() inside an iframe and it should fail. |
| 14 | 13 |
| 15 function load_iframe(src, sandbox) { | 14 function load_iframe(src, sandbox) { |
| 16 return new Promise(function(resolve) { | 15 return new Promise(function(resolve) { |
| 17 var iframe = document.createElement('iframe'); | 16 var iframe = document.createElement('iframe'); |
| 18 iframe.onload = function() { resolve(iframe); }; | 17 iframe.onload = function() { resolve(iframe); }; |
| 19 iframe.sandbox = sandbox; | 18 iframe.sandbox = sandbox; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 }).then(function(iframe) { | 65 }).then(function(iframe) { |
| 67 iframe.contentWindow.postMessage({}, '*'); | 66 iframe.contentWindow.postMessage({}, '*'); |
| 68 return wait_for_message(); | 67 return wait_for_message(); |
| 69 }).then(function(message) { | 68 }).then(function(message) { |
| 70 assert_equals(message.result, 'failed'); | 69 assert_equals(message.result, 'failed'); |
| 71 }); | 70 }); |
| 72 }, 'Unique origin is unable to create MediaKeys'); | 71 }, 'Unique origin is unable to create MediaKeys'); |
| 73 </script> | 72 </script> |
| 74 </body> | 73 </body> |
| 75 </html> | 74 </html> |
| OLD | NEW |