| 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 <script> | 9 <script> |
| 10 // When the sandbox attribute is present on an iframe, it will | 10 // When the sandbox attribute is present on an iframe, it will |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 ' return access.createMediaKeys();' + | 44 ' return access.createMediaKeys();' + |
| 45 ' }).then(function(mediaKeys) {' + | 45 ' }).then(function(mediaKeys) {' + |
| 46 ' window.parent.postMessage({result: \'allowed\'}
, \'*\');' + | 46 ' window.parent.postMessage({result: \'allowed\'}
, \'*\');' + |
| 47 ' }, function(error) {' + | 47 ' }, function(error) {' + |
| 48 ' window.parent.postMessage({result: \'failed\'},
\'*\');' + | 48 ' window.parent.postMessage({result: \'failed\'},
\'*\');' + |
| 49 ' });' + | 49 ' });' + |
| 50 ' };' + | 50 ' };' + |
| 51 '<\/script>'; | 51 '<\/script>'; |
| 52 | 52 |
| 53 // Verify that this page can create a MediaKeys first. | 53 // Verify that this page can create a MediaKeys first. |
| 54 navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{ | 54 return navigator.requestMediaKeySystemAccess('org.w3.clearkey',
[{ |
| 55 initDataTypes: [ 'keyids' ], | 55 initDataTypes: [ 'keyids' ], |
| 56 audioCapabilities: [ | 56 audioCapabilities: [ |
| 57 { contentType: 'audio/mp4; codecs="mp4a.40.2"' }, | 57 { contentType: 'audio/mp4; codecs="mp4a.40.2"' }, |
| 58 { contentType: 'audio/webm; codecs="opus"' } | 58 { contentType: 'audio/webm; codecs="opus"' } |
| 59 ] | 59 ] |
| 60 }]).then(function(access) { | 60 }]).then(function(access) { |
| 61 return access.createMediaKeys(); | 61 return access.createMediaKeys(); |
| 62 }).then(function(mediaKeys) { | 62 }).then(function(mediaKeys) { |
| 63 // Success, so now create the iframe and try there. | 63 // Success, so now create the iframe and try there. |
| 64 return load_iframe(script, 'allow-scripts') | 64 return load_iframe(script, 'allow-scripts'); |
| 65 }).then(function(iframe) { | 65 }).then(function(iframe) { |
| 66 iframe.contentWindow.postMessage({}, '*'); | 66 iframe.contentWindow.postMessage({}, '*'); |
| 67 return wait_for_message(); | 67 return wait_for_message(); |
| 68 }).then(function(message) { | 68 }).then(function(message) { |
| 69 assert_equals(message.result, 'failed'); | 69 assert_equals(message.result, 'failed'); |
| 70 }); | 70 }); |
| 71 }, 'Unique origin is unable to create MediaKeys'); | 71 }, 'Unique origin is unable to create MediaKeys'); |
| 72 </script> | 72 </script> |
| 73 </body> | 73 </body> |
| 74 </html> | 74 </html> |
| OLD | NEW |