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

Unified Diff: media/test/data/eme_player_js/clearkey_player.js

Issue 2426813002: EME: Close existing sessions on CDM failure (Closed)
Patch Set: add test Created 4 years, 2 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
Index: media/test/data/eme_player_js/clearkey_player.js
diff --git a/media/test/data/eme_player_js/clearkey_player.js b/media/test/data/eme_player_js/clearkey_player.js
index 369a6ab37433d4ca3f12273a3ca34c0f466d2187..298e9935f491475356035713367ecdc50494a248 100644
--- a/media/test/data/eme_player_js/clearkey_player.js
+++ b/media/test/data/eme_player_js/clearkey_player.js
@@ -25,9 +25,13 @@ ClearKeyPlayer.prototype.onMessage = function(message) {
var jwkSet = Utils.createJWKData(keyId, key);
Utils.timeLog('Calling update: ' + String.fromCharCode.apply(null, jwkSet));
message.target.update(jwkSet).catch(function(error) {
- // Ignore the error if a crash is expected. This ensures that the decoder
- // actually detects and reports the error.
- if (this.testConfig.keySystem != 'org.chromium.externalclearkey.crash') {
+ // If a crash is expected, wait for the session to be closed.
+ if (this.testConfig.keySystem == 'org.chromium.externalclearkey.crash') {
+ message.target.closed.then(
+ function(result) { Utils.setResultInTitle('SESSION_CLOSED'); },
+ function(error) { Utils.failTest(error); });
+ } else {
+ // Failure unexpected.
Utils.failTest(error, EME_UPDATE_FAILED);
}
});

Powered by Google App Engine
This is Rietveld 408576698