| 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>
|
|
|