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

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

Issue 2688263002: EME: close() should return a resolved promise if session already closed (Closed)
Patch Set: Created 3 years, 10 months 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/Source/modules/encryptedmedia/MediaKeySession.cpp » ('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-multiple-close-sequential.html
diff --git a/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-session-multiple-close-sequential.html b/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-session-multiple-close-sequential.html
new file mode 100644
index 0000000000000000000000000000000000000000..8aaf6ea4e64f586607c425fa9cdb0f841519188e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-session-multiple-close-sequential.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test multiple calls to MediaKeySession.close() sequentially</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 calls to close() on a closed session
+ // succeed, and always return a promise.
+
+ promise_test(function(test)
+ {
+ var initDataType;
+ var initData;
+ var mediaKeySession;
+
+ return 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 sequentially.
+ var p = mediaKeySession.close();
+ assert_true(p instanceof Promise);
+ return p;
+ }).then(function() {
+ var p = mediaKeySession.close();
+ assert_true(p instanceof Promise);
+ return p;
+ }).then(function() {
+ var p = mediaKeySession.close();
+ assert_true(p instanceof Promise);
+ return p;
+ });
+ }, 'Test multiple calls to MediaKeySession.close() sequentially.');
+ </script>
+ </body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698