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

Unified Diff: third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-session-multiple-close.html

Issue 2545083004: [eme] Handle multiple calls to MediaKeySession.close() (Closed)
Patch Set: rebase for MediaKeys rename 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/cdm/aes_decryptor.cc ('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/encrypted-media/encrypted-media-session-multiple-close.html
diff --git a/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-session-multiple-close.html b/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-session-multiple-close.html
new file mode 100644
index 0000000000000000000000000000000000000000..e6e832571605eeff3a1e311cf4411cd0c10f0644
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-session-multiple-close.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test multiple calls to MediaKeySession.close()</title>
+ <script src="encrypted-media-utils.js"></script>
+ <script src="../../resources/testharness.js"></script>
+ <script src="../../resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ // This test verifies that Chrome handles multiple close() calls
+ // correctly. Currently the EME spec has the check for session
+ // already closed happen immediately when the method is called,
+ // but the action is performed asynchronously.
+ // https://github.com/w3c/encrypted-media/issues/365
+
+ async_test(function(test)
+ {
+ var initDataType;
+ var initData;
+ var mediaKeySession;
+
+ 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() {
+ // Call close() multiple times.
+ return Promise.all([mediaKeySession.close(), mediaKeySession.close(), mediaKeySession.close()]);
+ }).then(function() {
+ test.done();
+ }).catch(function(error) {
+ forceTestFailureFromPromise(test, error);
+ });
+ }, 'Test multiple calls to MediaKeySession.close().');
+ </script>
+ </body>
+</html>
« no previous file with comments | « media/cdm/aes_decryptor.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698