Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 219 | 219 |
| 220 function sendRequestAttempt() { | 220 function sendRequestAttempt() { |
| 221 requestAttemptCount++; | 221 requestAttemptCount++; |
| 222 if (requestAttemptCount == MAXIMUM_REQUEST_ATTEMPTS) { | 222 if (requestAttemptCount == MAXIMUM_REQUEST_ATTEMPTS) { |
| 223 Utils.failTest('FAILED: Exceeded maximum license request attempts.'); | 223 Utils.failTest('FAILED: Exceeded maximum license request attempts.'); |
| 224 return; | 224 return; |
| 225 } | 225 } |
| 226 var xmlhttp = new XMLHttpRequest(); | 226 var xmlhttp = new XMLHttpRequest(); |
| 227 xmlhttp.responseType = responseType; | 227 xmlhttp.responseType = responseType; |
| 228 xmlhttp.open(requestType, serverURL, true); | 228 xmlhttp.open(requestType, serverURL, true); |
| 229 | 229 xmlhttp.onerror = function(e) { |
| 230 Utils.failTest('FAILED: Unable to request license.'); | |
|
ddorwin
2014/09/30 20:43:44
How about:
'FAILED: License request XHR failed.'
sandersd (OOO until July 31)
2014/09/30 20:56:35
Done.
The server URL is logged at the start of th
| |
| 231 }; | |
| 230 xmlhttp.onload = function(e) { | 232 xmlhttp.onload = function(e) { |
| 231 if (this.status == 200) { | 233 if (this.status == 200) { |
| 232 if (onSuccessCallbackFn) | 234 if (onSuccessCallbackFn) |
| 233 onSuccessCallbackFn(this.response); | 235 onSuccessCallbackFn(this.response); |
| 234 } else { | 236 } else { |
| 235 Utils.timeLog('Bad response status: ' + this.status); | 237 Utils.timeLog('Bad response status: ' + this.status); |
| 236 Utils.timeLog('Bad response: ' + this.response); | 238 Utils.timeLog('Bad response: ' + this.response); |
| 237 Utils.timeLog('Retrying request if possible in ' + | 239 Utils.timeLog('Retrying request if possible in ' + |
| 238 REQUEST_RETRY_DELAY_MS + 'ms'); | 240 REQUEST_RETRY_DELAY_MS + 'ms'); |
| 239 setTimeout(sendRequestAttempt, REQUEST_RETRY_DELAY_MS); | 241 setTimeout(sendRequestAttempt, REQUEST_RETRY_DELAY_MS); |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 267 var time = Utils.getCurrentTimeString(); | 269 var time = Utils.getCurrentTimeString(); |
| 268 // Log to document. | 270 // Log to document. |
| 269 Utils.documentLog(arguments[0], time); | 271 Utils.documentLog(arguments[0], time); |
| 270 // Log to JS console. | 272 // Log to JS console. |
| 271 var logString = time + ' - '; | 273 var logString = time + ' - '; |
| 272 for (var i = 0; i < arguments.length; i++) { | 274 for (var i = 0; i < arguments.length; i++) { |
| 273 logString += ' ' + arguments[i]; | 275 logString += ' ' + arguments[i]; |
| 274 } | 276 } |
| 275 console.log(logString); | 277 console.log(logString); |
| 276 }; | 278 }; |
| OLD | NEW |