Chromium Code Reviews| 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); |
| } |
| }); |