mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 05:45:37 +00:00
Bug 1463538 - Fail PaymentRequest UI tests upon console errors. r=jaws
MozReview-Commit-ID: 2IzUaENZjfl --HG-- extra : rebase_source : 3cce2b9a6ec32ba02c0fd60fa3c2c7ee1e6da0a5
This commit is contained in:
parent
791b509e81
commit
8be80047e1
@ -313,11 +313,27 @@ function cleanupFormAutofillStorage() {
|
||||
}
|
||||
|
||||
add_task(async function setup_head() {
|
||||
SpecialPowers.registerConsoleListener(function onConsoleMessage(msg) {
|
||||
if (msg.isWarning || !msg.errorMessage) {
|
||||
// Ignore warnings and non-errors.
|
||||
return;
|
||||
}
|
||||
if (msg.category == "CSP_CSPViolationWithURI" && msg.errorMessage.includes("at inline")) {
|
||||
// Ignore unknown CSP error.
|
||||
return;
|
||||
}
|
||||
if (msg.errorMessage.match(/docShell is null.*BrowserUtils.jsm/)) {
|
||||
// Bug 1478142 - Console spam from the Find Toolbar.
|
||||
return;
|
||||
}
|
||||
ok(false, msg.message || msg.errorMessage);
|
||||
});
|
||||
await setupFormAutofillStorage();
|
||||
registerCleanupFunction(function cleanup() {
|
||||
paymentSrv.cleanup();
|
||||
cleanupFormAutofillStorage();
|
||||
Services.prefs.clearUserPref(RESPONSE_TIMEOUT_PREF);
|
||||
SpecialPowers.postConsoleSentinel();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -46,3 +46,19 @@ function promiseContentToChromeMessage(messageType) {
|
||||
function deepClone(obj) {
|
||||
return JSON.parse(JSON.stringify(obj));
|
||||
}
|
||||
|
||||
// Listen for errors to fail tests
|
||||
SpecialPowers.registerConsoleListener(function onConsoleMessage(msg) {
|
||||
if (msg.isWarning || !msg.errorMessage) {
|
||||
// Ignore warnings and non-errors.
|
||||
return;
|
||||
}
|
||||
if (msg.category == "CSP_CSPViolationWithURI" && msg.errorMessage.includes("at inline")) {
|
||||
// Ignore unknown CSP error.
|
||||
return;
|
||||
}
|
||||
ok(false, msg.message || msg.errorMessage);
|
||||
});
|
||||
SimpleTest.registerCleanupFunction(function cleanup() {
|
||||
SpecialPowers.postConsoleSentinel();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user