mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Bug 750241 - Filter console messages to prevent intermittent orange; r=hsivonen
This commit is contained in:
parent
9e36b6f071
commit
412f59d922
@ -32,11 +32,17 @@ function resolveURL(relative) {
|
||||
return a.href;
|
||||
}
|
||||
|
||||
var resolvedURL = resolveURL(tests[0]);
|
||||
|
||||
var expectedErrors = [
|
||||
'[JavaScript Warning: "A form was submitted in the windows-1252 encoding which cannot encode all Unicode characters, so user input may get corrupted. To avoid this problem, the page should be changed so that the form is submitted in the UTF-8 encoding either by changing the encoding of the page itself to UTF-8 or by specifying accept-charset=utf-8 on the form element." {file: "' + resolveURL(tests[0]) + '" line: 1}]'
|
||||
'[JavaScript Warning: "A form was submitted in the windows-1252 encoding which cannot encode all Unicode characters, so user input may get corrupted. To avoid this problem, the page should be changed so that the form is submitted in the UTF-8 encoding either by changing the encoding of the page itself to UTF-8 or by specifying accept-charset=utf-8 on the form element." {file: "' + resolvedURL + '" line: 1}]'
|
||||
];
|
||||
|
||||
function consoleError(msg) {
|
||||
function consoleError(msg, fileName) {
|
||||
// Ignore messages not generated by the test
|
||||
if (fileName !== resolvedURL) {
|
||||
return;
|
||||
}
|
||||
var expected = expectedErrors.shift();
|
||||
is(msg, expected, "Not the right error message");
|
||||
}
|
||||
|
@ -756,7 +756,13 @@ SpecialPowersAPI.prototype = {
|
||||
var consoleListener = {
|
||||
userListener: listener,
|
||||
observe: function(consoleMessage) {
|
||||
this.userListener(consoleMessage.message);
|
||||
var fileName;
|
||||
try {
|
||||
fileName = consoleMessage.QueryInterface(Ci.nsIScriptError)
|
||||
.sourceName;
|
||||
} catch (e) {
|
||||
}
|
||||
this.userListener(consoleMessage.message, fileName);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user