зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1117566 - Fix some JavaScript warnings in SimpleTest runner. r=jmaher
This commit is contained in:
Родитель
f435e22a55
Коммит
c8da89cfae
|
@ -5,6 +5,9 @@
|
|||
* type = eventName (QuitApplication)
|
||||
* data = json object {"filename":filename} <- for LoggerInit
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
function getElement(id) {
|
||||
return ((typeof(id) == "string") ?
|
||||
document.getElementById(id) : id);
|
||||
|
@ -264,6 +267,7 @@ function StructuredLogger(name) {
|
|||
} else {
|
||||
str = LOG_DELIMITER + JSON.stringify(message) + LOG_DELIMITER;
|
||||
}
|
||||
|
||||
// BUGFIX: browser-chrome tests doesn't use LogController
|
||||
if (Object.keys(LogController.listeners).length !== 0) {
|
||||
LogController.log(str);
|
||||
|
@ -272,7 +276,7 @@ function StructuredLogger(name) {
|
|||
}
|
||||
|
||||
// Checking for error messages
|
||||
if (message.expected || message.level === "ERROR") {
|
||||
if (message.expected || (message.level && message.level === "ERROR")) {
|
||||
TestRunner.failureHandler();
|
||||
}
|
||||
};
|
||||
|
@ -281,7 +285,6 @@ function StructuredLogger(name) {
|
|||
this.validMessage = function(message) {
|
||||
return message.action !== undefined && VALID_ACTIONS.indexOf(message.action) >= 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,14 +4,17 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
TestRunner.logEnabled = true;
|
||||
TestRunner.logger = LogController;
|
||||
|
||||
/* Helper function */
|
||||
parseQueryString = function(encodedString, useArrays) {
|
||||
function parseQueryString(encodedString, useArrays) {
|
||||
// strip a leading '?' from the encoded string
|
||||
var qstr = (encodedString[0] == "?") ? encodedString.substring(1) :
|
||||
encodedString;
|
||||
var qstr = (encodedString.length > 0 && encodedString[0] == "?")
|
||||
? encodedString.substring(1)
|
||||
: encodedString;
|
||||
var pairs = qstr.replace(/\+/g, "%20").split(/(\&\;|\&\#38\;|\&|\&)/);
|
||||
var o = {};
|
||||
var decode;
|
||||
|
|
Загрузка…
Ссылка в новой задаче