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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp » ('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 multiple calls to MediaKeySession.close() sequentially</titl e>
5 <script src="encrypted-media-utils.js"></script>
6 <script src="../../resources/testharness.js"></script>
7 <script src="../../resources/testharnessreport.js"></script>
8 </head>
9 <body>
10 <script>
11 // This test verifies that calls to close() on a closed session
12 // succeed, and always return a promise.
13
14 promise_test(function(test)
15 {
16 var initDataType;
17 var initData;
18 var mediaKeySession;
19
20 return navigator.requestMediaKeySystemAccess(
21 'org.w3.clearkey',
22 getSimpleConfiguration()).then(function(access) {
23 initDataType = access.getConfiguration().initDataTypes[0];
24 initData = getInitData(initDataType);
25 return access.createMediaKeys();
26 }).then(function(mediaKeys) {
27 mediaKeySession = mediaKeys.createSession();
28 return mediaKeySession.generateRequest(initDataType, initDat a);
29 }).then(function() {
30 // Call close() multiple times sequentially.
31 var p = mediaKeySession.close();
32 assert_true(p instanceof Promise);
33 return p;
34 }).then(function() {
35 var p = mediaKeySession.close();
36 assert_true(p instanceof Promise);
37 return p;
38 }).then(function() {
39 var p = mediaKeySession.close();
40 assert_true(p instanceof Promise);
41 return p;
42 });
43 }, 'Test multiple calls to MediaKeySession.close() sequentially.');
44 </script>
45 </body>
46 </html>
OLDNEW
« 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