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

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

Issue 1717033002: EME: Fix the CDM File IO test when run using unprefixed EME. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
Index: media/test/data/eme_player_js/file_io_test_player.js
diff --git a/media/test/data/eme_player_js/file_io_test_player.js b/media/test/data/eme_player_js/file_io_test_player.js
index 583d422a14e484001b222ba282cb2fd4d72cfda5..5136e7d9a83a63c541659b3990bc34b532a2b718 100644
--- a/media/test/data/eme_player_js/file_io_test_player.js
+++ b/media/test/data/eme_player_js/file_io_test_player.js
@@ -15,18 +15,21 @@ FileIOTestPlayer.prototype.init = function() {
FileIOTestPlayer.prototype.registerEventListeners = function() {
// Returns a promise.
- return PlayerUtils.registerPrefixedEMEEventListeners(this);
+ return PlayerUtils.registerEMEEventListeners(this).then(function(result) {
+ return PlayerUtils.registerPrefixedEMEEventListeners(this);
+ });
};
handleMessage = function(message) {
// The test result is either '0' or '1' appended to the header.
- if (Utils.hasPrefix(message.message, FILE_IO_TEST_RESULT_HEADER)) {
- if (message.message.length != FILE_IO_TEST_RESULT_HEADER.length + 1) {
- Utils.failTest('Unexpected FileIOTest CDM message' + message.message);
+ var msg = Utils.convertToUint8Array(message.message);
+ if (Utils.hasPrefix(msg, FILE_IO_TEST_RESULT_HEADER)) {
+ if (msg.length != FILE_IO_TEST_RESULT_HEADER.length + 1) {
+ Utils.failTest('Unexpected FileIOTest CDM message' + msg);
return;
}
var result_index = FILE_IO_TEST_RESULT_HEADER.length;
- var success = String.fromCharCode(message.message[result_index]) == 1;
+ var success = String.fromCharCode(msg[result_index]) == 1;
Utils.timeLog('CDM file IO test: ' + (success ? 'Success' : 'Fail'));
if (success)
Utils.setResultInTitle(FILE_IO_TEST_SUCCESS);
« no previous file with comments | « no previous file | media/test/data/eme_player_js/player_utils.js » ('j') | media/test/data/eme_player_js/utils.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698