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

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

Issue 544283002: Update eme_player to handle MediaKeySession.generateRequest() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | 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 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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698