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