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

Side by Side 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 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Test close the key session associated with the object when the pa ge is inaccessible</title>
5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script>
7 </head>
8 <body>
9 <script>
10 var iframe;
11
12 function load_iframe(src) {
13 return new Promise(function(resolve) {
14 iframe = document.createElement('iframe');
15 iframe.onload = function() { resolve(iframe); };
16 iframe.src = src;
17 document.documentElement.appendChild(iframe);
18 });
19 }
20
21 function wait_for_message() {
22 return new Promise(function(resolve) {
23 self.addEventListener('message', function listener(e) {
24 if (e.data.comm == 'init-completed') {
25 iframe.contentWindow.postMessage({comm: 'close'}, '* ');
26 } else if (e.data.comm == 'close-received') {
27 iframe.remove();
28 window.postMessage({result: 'finished'}, '*');
29 } else {
30 resolve(e.data);
31 self.removeEventListener('message', listener);
32 }
33 });
34 });
35 }
36
37 async_test(function(test) {
38 load_iframe("../resources/encrypted-media-session-close-and-conte xt-destroyed-iframe.html").then(function(iframe) {
39 iframe.contentWindow.postMessage({comm: 'init'}, '*');
40 return wait_for_message();
41 }).then(function(message) {
42 assert_equals(message.result, 'finished');
43 test.done();
44 });
45 }, 'Test close the key session associated with the object when the p age is inaccessible');
46 </script>
47 </body>
48 </html>
OLDNEW
« 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