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

Unified Diff: media/test/data/eme_player_js/player_utils.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
« no previous file with comments | « media/test/data/eme_player_js/clearkey_player.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/test/data/eme_player_js/player_utils.js
diff --git a/media/test/data/eme_player_js/player_utils.js b/media/test/data/eme_player_js/player_utils.js
index e640d9072e3e74ad8cf2bb77edf539b0b1be10ff..edec083ecab3572ebdcb8bd0d480dacb7df5c409 100644
--- a/media/test/data/eme_player_js/player_utils.js
+++ b/media/test/data/eme_player_js/player_utils.js
@@ -28,9 +28,11 @@ PlayerUtils.registerDefaultEventListeners = function(player) {
player.video.addEventListener('error', function(error) {
// This most likely happens on pipeline failures (e.g. when the CDM
- // crashes).
+ // crashes). Don't report a failure if the test is expecting a crash.
Utils.timeLog('onHTMLElementError', error);
- Utils.failTest(error);
+ if (player.testConfig.keySystem != 'org.chromium.externalclearkey.crash') {
+ Utils.failTest(error);
+ }
});
};
@@ -77,10 +79,16 @@ PlayerUtils.registerEMEEventListeners = function(player) {
addMediaKeySessionListeners(session);
session.generateRequest(message.initDataType, message.initData)
.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 !=
+ // If a crash is expected, wait for the session to be closed.
xhwang 2016/10/20 22:38:59 We added the crash test to make sure if the CDM cr
jrummell 2016/11/01 01:08:46 Yes. Restored the original tests, added 2 new ones
+ if (this.testConfig.keySystem ==
'org.chromium.externalclearkey.crash') {
+ session.closed.then(
+ function(result) {
+ Utils.setResultInTitle('SESSION_CLOSED');
+ },
+ function(error) { Utils.failTest(error); });
+ } else {
+ // Failure unexpected.
Utils.failTest(error, EME_GENERATEREQUEST_FAILED);
}
});
« no previous file with comments | « media/test/data/eme_player_js/clearkey_player.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698