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

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: 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..fc6be5b1532b0a3d1b3d6fa747f2ca3d54090c00 100644
--- a/media/test/data/eme_player_js/utils.js
+++ b/media/test/data/eme_player_js/utils.js
@@ -202,7 +202,19 @@ Utils.installTitleEventHandler = function(element, event) {
}, false);
};
-Utils.isHeartBeatMessage = function(msg) {
+Utils.isHeartBeatMessage = function(message) {
+ if (message.messageType == 'license-renewal') {
ddorwin 2015/01/14 23:24:52 nit: Unless the rest of the code follows this patt
jrummell 2015/01/15 01:32:56 Done.
+ if (!Utils.isHeartBeatMessagePrefixed(message.message)) {
+ Utils.failTest(
+ 'license-renewal message doesn\'t contain HEART_BEAT_HEADER',
+ KEY_ERROR);
+ }
+ return true;
+ }
+ return false;
+};
+
+Utils.isHeartBeatMessagePrefixed = function(msg) {
return Utils.hasPrefix(Utils.convertToUint8Array(msg), HEART_BEAT_HEADER);
};

Powered by Google App Engine
This is Rietveld 408576698