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 ac7b6dd10e56a0bf23613fb42b68ed3557babdf6..cd1bb0b8758c1163d21377288bdd5fadb3d6ffa1 100644 |
| --- a/media/test/data/eme_player_js/player_utils.js |
| +++ b/media/test/data/eme_player_js/player_utils.js |
| @@ -57,15 +57,26 @@ PlayerUtils.registerEMEEventListeners = function(player) { |
| message.contentType + ', initData: ' + |
| Utils.getHexString(message.initData)); |
| try { |
| - var session = message.target.mediaKeys.createSession( |
| - message.contentType, message.initData); |
| - if (PROMISES_SUPPORTED) { |
| - session.then(addMediaKeySessionListeners) |
| - .catch (function(error) { |
| - Utils.failTest(error, KEY_ERROR); |
| - }); |
| - } else { |
| + if (message.target.mediaKeys.createSession.length == 0) { |
| + // FIXME(jrummell): Remove this test (and else branch) once blink |
| + // uses the new API. |
| + var session = message.target.mediaKeys.createSession(); |
| addMediaKeySessionListeners(session); |
| + session.generateRequest(message.contentType, message.initData) |
| + .catch (function(error) { |
|
ddorwin
2014/09/08 17:50:09
remove the space here and below
jrummell
2014/09/08 18:21:05
Done. Note that clang-format wants to put the spac
|
| + Utils.failTest(error, KEY_ERROR); |
|
ddorwin
2014/09/08 17:50:09
What is KEY_ERROR? Why do these all fail with that
jrummell
2014/09/08 18:21:05
KEY_ERROR is simply the string "KEY_ERROR". It is
|
| + }); |
| + } else { |
| + var session = message.target.mediaKeys.createSession( |
| + message.contentType, message.initData); |
| + if (PROMISES_SUPPORTED) { |
|
ddorwin
2014/09/08 17:50:09
Can we remove this now? Probably in a separate CL
jrummell
2014/09/08 18:21:05
Yes. However, this test is done in several files,
|
| + session.then(addMediaKeySessionListeners) |
| + .catch (function(error) { |
| + Utils.failTest(error, KEY_ERROR); |
| + }); |
| + } else { |
| + addMediaKeySessionListeners(session); |
| + } |
| } |
| } catch (e) { |
| Utils.failTest(e); |