| Index: third_party/WebKit/LayoutTests/media/resources/encrypted-media-session-close-and-context-destroyed-iframe.html
|
| diff --git a/third_party/WebKit/LayoutTests/media/resources/encrypted-media-session-close-and-context-destroyed-iframe.html b/third_party/WebKit/LayoutTests/media/resources/encrypted-media-session-close-and-context-destroyed-iframe.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..1afcce1ecbb76f098f42b877b293b1f486ccd12f
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/media/resources/encrypted-media-session-close-and-context-destroyed-iframe.html
|
| @@ -0,0 +1,32 @@
|
| +<html>
|
| +<head>
|
| +<script src="../encrypted-media/encrypted-media-utils.js"></script>
|
| +</head>
|
| +<body>
|
| +<script>
|
| + var initDataType;
|
| + var initData;
|
| + var mediaKeySession;
|
| +
|
| + window.onmessage = function(e) {
|
| + if (e.data.comm == 'init') {
|
| + navigator.requestMediaKeySystemAccess('org.w3.clearkey', getSimpleConfiguration()).then(function(access) {
|
| + initDataType = access.getConfiguration().initDataTypes[0];
|
| + initData = getInitData(initDataType);
|
| + return access.createMediaKeys();
|
| + }).then(function(mediaKeys) {
|
| + mediaKeySession = mediaKeys.createSession();
|
| + return mediaKeySession.generateRequest(initDataType, initData);
|
| + }).then(function() {
|
| + window.parent.postMessage({comm: 'init-completed'}, '*');
|
| + });
|
| + } else if (e.data.comm == 'close') {
|
| + window.parent.postMessage({comm: 'close-received'}, '*');
|
| + mediaKeySession.close().catch(function(error) {
|
| + window.parent.postMessage({result: 'error'}, '*');
|
| + });
|
| + }
|
| + };
|
| +</script>'
|
| +</body>
|
| +</html>
|
|
|