Bug 1648712 - prevent false alarm of console message from dom telemetry push, r=lina

Differential Revision: https://phabricator.services.mozilla.com/D81389
This commit is contained in:
Junior Hsu 2020-06-26 19:56:20 +00:00
Родитель b03f0a875d
Коммит 2d6bb5fd1e
1 изменённых файлов: 9 добавлений и 0 удалений

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

@ -35,6 +35,15 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=884693
is(xhr.responseText, expectedResponse, "Correct responseText returned");
let messages = consoleService.getMessageArray() || [];
// broadcastlisteners can happen and cause false alarm.
messages = messages.filter(msg =>
!(msg instanceof Ci.nsIScriptError &&
msg.category.includes("chrome javascript") &&
msg.message.includes("Unknown event")));
if (messages.length > 0) {
info(`Got console messages ${messages}`);
}
is(messages.length, expectedMessages.length, "Got expected message count");
messages = messages.map(m => m.message).join(",");
for(let message of expectedMessages) {