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

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

Issue 2426813002: EME: Close existing sessions on CDM failure (Closed)
Patch Set: add new tests Created 4 years, 1 month 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..0c6745d0087e086531959a3e5bd66b493b161549 100644
--- a/media/test/data/eme_player_js/clearkey_player.js
+++ b/media/test/data/eme_player_js/clearkey_player.js
@@ -25,9 +25,15 @@ 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 (this.testConfig.keySystem == CLOSE_ON_CRASH_TEST_KEYSYSTEM) {
+ // Failure is expected, wait for the session to be closed.
+ message.target.closed.then(
+ function(result) { Utils.setResultInTitle('SESSION_CLOSED'); },
+ function(error) { Utils.failTest(error); });
+ } else if (this.testConfig.keySystem == ERROR_ON_CRASH_TEST_KEYSYSTEM) {
+ // Ignore the failure if a crash is expected. This ensures that
+ // the decoder actually detects and reports the error.
xhwang 2016/11/04 22:37:41 Since these two tests have exactly the same behavi
jrummell 2016/11/07 22:03:47 Done.
+ } else {
Utils.failTest(error, EME_UPDATE_FAILED);
}
});

Powered by Google App Engine
This is Rietveld 408576698