Bug 1797115 - [bidi] Rename log entry level warning to warn r=webdriver-reviewers,jgraham

Differential Revision: https://phabricator.services.mozilla.com/D161586
This commit is contained in:
Julian Descottes 2022-11-08 17:27:01 +00:00
Родитель 6b60c1d24f
Коммит 8d6c7589a8
5 изменённых файлов: 8 добавлений и 12 удалений

Просмотреть файл

@ -36,7 +36,7 @@ XPCOMUtils.defineLazyGetter(lazy, "ConsoleAPIStorage", () => {
* The ConsoleAPIListener emits "message" events, with the following object as
* payload:
* - {Array<Object>} arguments - Arguments as passed-in when the method was called.
* - {String} level - Importance, one of `info`, `warning`, `error`, `debug`, `trace`.
* - {String} level - Importance, one of `info`, `warn`, `error`, `debug`, `trace`.
* - {Array<Object>} stacktrace - List of stack frames, starting from most recent.
* - {Number} timeStamp - Timestamp when the method was called.
*/

Просмотреть файл

@ -19,7 +19,7 @@ XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
* The ConsoleListener can be used to listen for console messages related to
* Javascript errors, certain warnings which all happen within a specific
* windowGlobal. Consumers can listen for the message types "error",
* "warning" and "info".
* "warn" and "info".
*
* Example:
* ```
@ -36,9 +36,9 @@ XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
* ```
*
* @emits message
* The ConsoleListener emits "error", "warning" and "info" events, with the
* The ConsoleListener emits "error", "warn" and "info" events, with the
* following object as payload:
* - {String} level - Importance, one of `info`, `warning`, `error`,
* - {String} level - Importance, one of `info`, `warn`, `error`,
* `debug`, `trace`.
* - {String} message - Actual message from the console entry.
* - {Array<StackFrame>} stacktrace - List of stack frames,
@ -129,7 +129,7 @@ export class ConsoleListener {
let level;
if ((message.flags & warningFlag) == warningFlag) {
level = "warning";
level = "warn";
} else if ((message.flags & infoFlag) == infoFlag) {
level = "info";
} else if ((message.flags & errorFlag) == errorFlag) {

Просмотреть файл

@ -20,7 +20,7 @@ add_task(async function test_message_properties() {
});
add_task(async function test_level() {
for (const level of ["error", "info", "warning"]) {
for (const level of ["error", "info", "warn"]) {
const listenerId = await listenToConsoleMessage(level);
await logConsoleMessage({ message: "foo", level });
const message = await getConsoleMessage(listenerId);
@ -72,7 +72,7 @@ function logConsoleMessage(options = {}) {
const levelToFlags = {
error: Ci.nsIScriptError.errorFlag,
info: Ci.nsIScriptError.infoFlag,
warning: Ci.nsIScriptError.warningFlag,
warn: Ci.nsIScriptError.warningFlag,
};
const scriptError = Cc["@mozilla.org/scripterror;1"].createInstance(

Просмотреть файл

@ -91,8 +91,7 @@ class LogModule extends Module {
case "trace":
return "debug";
case "warn":
case "warning":
return "warning";
return "warn";
default:
return "info";
}

Просмотреть файл

@ -1,3 +0,0 @@
[console.py]
[test_level[warn-warn\]]
expected: FAIL