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

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

Issue 854633003: Verify heartbeat messages have type 'license-renewal' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove heartbeat Created 5 years, 11 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/utils.js
diff --git a/media/test/data/eme_player_js/utils.js b/media/test/data/eme_player_js/utils.js
index 3619d4e5426f5ceaab5b03686ea42e839e3b42b2..9d7bb1b4d4425883dbfbb815f7073ce4ee467c5b 100644
--- a/media/test/data/eme_player_js/utils.js
+++ b/media/test/data/eme_player_js/utils.js
@@ -202,8 +202,22 @@ Utils.installTitleEventHandler = function(element, event) {
}, false);
};
-Utils.isHeartBeatMessage = function(msg) {
- return Utils.hasPrefix(Utils.convertToUint8Array(msg), HEART_BEAT_HEADER);
+Utils.isRenewalMessage = function(message) {
+ if (message.messageType != 'license-renewal')
+ return false;
+
+ if (!Utils.isRenewalMessagePrefixed(message.message)) {
+ Utils.failTest('license-renewal message doesn\'t contain expected header',
+ KEY_ERROR);
+ }
+ return true;
+};
+
+// For the prefixed API renewal messages are determined by looking at the
+// message and finding a known string.
+Utils.isRenewalMessagePrefixed = function(msg) {
+ return Utils.hasPrefix(Utils.convertToUint8Array(msg),
+ RENEWAL_MESSAGE_HEADER);
};
Utils.resetTitleChange = function() {
« media/test/data/eme_player_js/globals.js ('K') | « media/test/data/eme_player_js/player_utils.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698