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

Side by Side Diff: media/test/data/eme_player_js/utils.js

Issue 1712903002: Remove prefixed EME. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove all prefixed-related code from the EME browser tests. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Utils provide logging functions and other JS functions commonly used by the 5 // Utils provide logging functions and other JS functions commonly used by the
6 // app and media players. 6 // app and media players.
7 var Utils = new function() { 7 var Utils = new function() {
8 this.titleChanged = false; 8 this.titleChanged = false;
9 }; 9 };
10 10
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 Utils.installTitleEventHandler = function(element, event) { 182 Utils.installTitleEventHandler = function(element, event) {
183 element.addEventListener(event, function(e) { 183 element.addEventListener(event, function(e) {
184 Utils.setResultInTitle(e.type); 184 Utils.setResultInTitle(e.type);
185 }, false); 185 }, false);
186 }; 186 };
187 187
188 Utils.isRenewalMessage = function(message) { 188 Utils.isRenewalMessage = function(message) {
189 if (message.messageType != 'license-renewal') 189 if (message.messageType != 'license-renewal')
190 return false; 190 return false;
191 191
192 if (!Utils.isRenewalMessagePrefixed(message.message)) { 192 if (!Utils.hasPrefix(msg, EME_RENEWAL_MESSAGE_HEADER)) {
ddorwin 2016/02/20 01:04:46 Even though this isn't strictly necessary anymore,
193 Utils.failTest('license-renewal message doesn\'t contain expected header', 193 Utils.failTest('license-renewal message doesn\'t contain expected header',
194 PREFIXED_EME_RENEWAL_MISSING_HEADER); 194 EME_RENEWAL_MISSING_HEADER);
195 } 195 }
196 return true; 196 return true;
197 }; 197 };
198 198
199 // For the prefixed API renewal messages are determined by looking at the
200 // message and finding a known string.
201 Utils.isRenewalMessagePrefixed = function(msg) {
202 return Utils.hasPrefix(msg, PREFIXED_EME_RENEWAL_MESSAGE_HEADER);
203 };
204
205 Utils.resetTitleChange = function() { 199 Utils.resetTitleChange = function() {
206 this.titleChanged = false; 200 this.titleChanged = false;
207 document.title = ''; 201 document.title = '';
208 }; 202 };
209 203
210 Utils.sendRequest = function( 204 Utils.sendRequest = function(
211 requestType, responseType, message, serverURL, onResponseCallbackFn, 205 requestType, responseType, message, serverURL, onResponseCallbackFn,
212 forceInvalidResponse) { 206 forceInvalidResponse) {
213 var requestAttemptCount = 0; 207 var requestAttemptCount = 0;
214 var REQUEST_RETRY_DELAY_MS = 3000; 208 var REQUEST_RETRY_DELAY_MS = 3000;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 var time = Utils.getCurrentTimeString(); 269 var time = Utils.getCurrentTimeString();
276 // Log to document. 270 // Log to document.
277 Utils.documentLog(arguments[0], time); 271 Utils.documentLog(arguments[0], time);
278 // Log to JS console. 272 // Log to JS console.
279 var logString = time + ' - '; 273 var logString = time + ' - ';
280 for (var i = 0; i < arguments.length; i++) { 274 for (var i = 0; i < arguments.length; i++) {
281 logString += ' ' + arguments[i]; 275 logString += ' ' + arguments[i];
282 } 276 }
283 console.log(logString); 277 console.log(logString);
284 }; 278 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698