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

Unified Diff: third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-keystatuses.html

Issue 2108033002: EME: Clear Key CDM now generates keystatuseschange event on close() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update unittest Created 4 years, 6 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 | « media/cdm/aes_decryptor_unittest.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-keystatuses.html
diff --git a/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-keystatuses.html b/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-keystatuses.html
index 3654f8c273b373c8a186a655646ba69ce48d7a07..91922bbe08e32e4de75a9b2f1f6b5383214fbad8 100644
--- a/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-keystatuses.html
+++ b/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-keystatuses.html
@@ -14,6 +14,7 @@
var mediaKeySession;
var initDataType;
var initData;
+ var closed = false;
// Even though key ids are uint8, using printable values so that
// they can be verified easily.
@@ -39,7 +40,7 @@
});
}
- function processKeyStatusesChange(event)
+ function checkKeyStatusFor2Keys()
{
// Two keys added, so both should show up in |keyStatuses|.
assert_equals(mediaKeySession.keyStatuses.size, 2);
@@ -124,8 +125,28 @@
invalid6.set(key1, 0); // Last element will be 0.
assert_false(mediaKeySession.keyStatuses.has(invalid6));
assert_equals(mediaKeySession.keyStatuses.get(invalid6), undefined);
+ }
- test.done();
+ function processKeyStatusesChange(event)
+ {
+ if ( !closed )
+ {
+ // The first keystatuseschange (caused by update())
+ // should include both keys.
+ checkKeyStatusFor2Keys();
+
+ mediaKeySession.close().catch(function(error) {
+ forceTestFailureFromPromise(test, error);
+ });
+ closed = true;
+ }
+ else
+ {
+ // The second keystatuseschange (caused by close())
+ // should not have any keys.
+ assert_equals(mediaKeySession.keyStatuses.size, 0);
+ test.done();
+ }
}
getSupportedInitDataType().then(function(type) {
« no previous file with comments | « media/cdm/aes_decryptor_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698