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

Unified Diff: third_party/WebKit/LayoutTests/media/resources/encrypted-media-session-close-and-context-destroyed-iframe.html

Issue 2454333002: Add EME Layout test for unclosed the key session (Closed)
Patch Set: Add EME Layout test for unclosed the key session Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-session-close-and-context-destroyed.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-session-close-and-context-destroyed.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698