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

Unified Diff: third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-session-close-and-context-destroyed.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 | « no previous file | third_party/WebKit/LayoutTests/media/resources/encrypted-media-session-close-and-context-destroyed-iframe.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-session-close-and-context-destroyed.html
diff --git a/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-session-close-and-context-destroyed.html b/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-session-close-and-context-destroyed.html
new file mode 100644
index 0000000000000000000000000000000000000000..0bb89c7455c70fe5502bb093b9b04309daaa8206
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-session-close-and-context-destroyed.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test close the key session associated with the object when the page is inaccessible</title>
+ <script src="../../resources/testharness.js"></script>
+ <script src="../../resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ var iframe;
+
+ function load_iframe(src) {
+ return new Promise(function(resolve) {
+ iframe = document.createElement('iframe');
+ iframe.onload = function() { resolve(iframe); };
+ iframe.src = src;
+ document.documentElement.appendChild(iframe);
+ });
+ }
+
+ function wait_for_message() {
+ return new Promise(function(resolve) {
+ self.addEventListener('message', function listener(e) {
+ if (e.data.comm == 'init-completed') {
+ iframe.contentWindow.postMessage({comm: 'close'}, '*');
+ } else if (e.data.comm == 'close-received') {
+ iframe.remove();
+ window.postMessage({result: 'finished'}, '*');
+ } else {
+ resolve(e.data);
+ self.removeEventListener('message', listener);
+ }
+ });
+ });
+ }
+
+ async_test(function(test) {
+ load_iframe("../resources/encrypted-media-session-close-and-context-destroyed-iframe.html").then(function(iframe) {
+ iframe.contentWindow.postMessage({comm: 'init'}, '*');
+ return wait_for_message();
+ }).then(function(message) {
+ assert_equals(message.result, 'finished');
+ test.done();
+ });
+ }, 'Test close the key session associated with the object when the page is inaccessible');
+ </script>
+ </body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/resources/encrypted-media-session-close-and-context-destroyed-iframe.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698