Bug 1650155 - Remove remaining mentions of whitelist in files using allowMatchingRejectionsGlobally r=Gijs

Depends on D82059

Differential Revision: https://phabricator.services.mozilla.com/D82061
This commit is contained in:
Julian Descottes 2020-07-03 16:57:25 +00:00
Родитель 3e1e4c22b6
Коммит 3ec6af87ab
9 изменённых файлов: 21 добавлений и 19 удалений

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

@ -4,9 +4,9 @@
// The rejection "The fetching process for the media resource was aborted by the
// user agent at the user's request." is left unhandled in some cases. This bug
// should be fixed, but for the moment this file is whitelisted.
// should be fixed, but for the moment this file allows a class of rejections.
//
// NOTE: Whitelisting a class of rejections should be limited. Normally you
// NOTE: Allowing a whole class of rejections should be avoided. Normally you
// should use "expectUncaughtRejection" to flag individual failures.
ChromeUtils.import("resource://testing-common/PromiseTestUtils.jsm", this);
PromiseTestUtils.allowMatchingRejectionsGlobally(/aborted by the user agent/);

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

@ -32,10 +32,12 @@
*/
// There are shutdown issues for which multiple rejections are left uncaught.
// This bug should be fixed, but for the moment this directory is whitelisted.
// This bug should be fixed, but for the moment all tests in this directory
// allow various classes of promise rejections.
//
// NOTE: Entire directory whitelisting should be kept to a minimum. Normally you
// should use "expectUncaughtRejection" to flag individual failures.
// NOTE: Allowing rejections on an entire directory should be avoided.
// Normally you should use "expectUncaughtRejection" to flag individual
// failures.
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);

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

@ -27,9 +27,9 @@
ChromeUtils.import("resource:///modules/sessionstore/SessionStartup.jsm", this);
// The rejection "BrowserWindowTracker.getTopWindow(...) is null" is left
// unhandled in some cases. This bug should be fixed, but for the moment this
// file is whitelisted.
// file allows a class of rejections.
//
// NOTE: Whitelisting a class of rejections should be limited. Normally you
// NOTE: Allowing a whole class of rejections should be avoided. Normally you
// should use "expectUncaughtRejection" to flag individual failures.
ChromeUtils.import("resource://testing-common/PromiseTestUtils.jsm", this);
PromiseTestUtils.allowMatchingRejectionsGlobally(/getTopWindow/);

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

@ -7,9 +7,9 @@
"use strict";
// The folllowing rejection is left unhandled in some cases. This bug should be
// fixed, but for the moment this file is whitelisted.
// fixed, but for the moment this file allows a class of rejections.
//
// NOTE: Whitelisting a class of rejections should be limited. Normally you
// NOTE: Allowing a whole class of rejections should be avoided. Normally you
// should use "expectUncaughtRejection" to flag individual failures.
ChromeUtils.import("resource://testing-common/PromiseTestUtils.jsm", this);
PromiseTestUtils.allowMatchingRejectionsGlobally(/NS_ERROR_ILLEGAL_VALUE/);

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

@ -2015,7 +2015,7 @@ const { PromiseTestUtils } = ChromeUtils.import(
// Debugger operations that are canceled because they were rendered obsolete by
// a navigation or pause/resume end up as uncaught rejections. These never
// indicate errors and are whitelisted in all debugger tests.
// indicate errors and are allowed in all debugger tests.
PromiseTestUtils.allowMatchingRejectionsGlobally(/Page has navigated/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/Current thread has changed/);
PromiseTestUtils.allowMatchingRejectionsGlobally(

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

@ -13,7 +13,7 @@ const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
// whitelist a context error because it is harmless. This could likely be removed in the next patch because it is a symptom of events coming from the target-list and debugger targets module...
// allow a context error because it is harmless. This could likely be removed in the next patch because it is a symptom of events coming from the target-list and debugger targets module...
PromiseTestUtils.allowMatchingRejectionsGlobally(/Page has navigated/);
const TEST_URL =

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

@ -3,7 +3,7 @@ let JSMPromise = ChromeUtils.import("resource://gre/modules/Promise.jsm", {})
.Promise;
ChromeUtils.import("resource://testing-common/PromiseTestUtils.jsm", this);
PromiseTestUtils.allowRejectionsGlobally(/Whitelisted rejection./);
PromiseTestUtils.allowRejectionsGlobally(/Allowed rejection./);
PromiseTestUtils.expectUncaughtRejection(/Promise.jsm rejection./);
PromiseTestUtils.expectUncaughtRejection(/Promise.jsm rejection./);
PromiseTestUtils.expectUncaughtRejection(/Promise rejection./);
@ -12,8 +12,8 @@ PromiseTestUtils.expectUncaughtRejection(/Promise rejection./);
function test() {
Promise.reject(new Error("Promise rejection."));
Promise.reject(new Error("Promise rejection."));
Promise.reject(new Error("Whitelisted rejection."));
Promise.reject(new Error("Allowed rejection."));
JSMPromise.reject(new Error("Promise.jsm rejection."));
JSMPromise.reject(new Error("Promise.jsm rejection."));
JSMPromise.reject(new Error("Whitelisted rejection."));
JSMPromise.reject(new Error("Allowed rejection."));
}

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

@ -3,7 +3,7 @@
/*
* Detects and reports unhandled rejections during test runs. Test harnesses
* will fail tests in this case, unless the test whitelists itself.
* will fail tests in this case, unless the test explicitly allows rejections.
*/
"use strict";
@ -125,7 +125,7 @@ var PromiseTestUtils = {
},
/**
* Called by tests that have been whitelisted, disables the observers in this
* Called by tests with uncaught rejections to disable the observers in this
* module. For new tests where uncaught rejections are expected, you should
* use the more granular expectUncaughtRejection function instead.
*/
@ -228,7 +228,7 @@ var PromiseTestUtils = {
/**
* Fails the test if there are any uncaught rejections at this time that have
* not been whitelisted using expectUncaughtRejection.
* not been explicitly allowed using expectUncaughtRejection.
*
* Depending on the configuration of the test suite, this function might only
* report the details of the first uncaught rejection that was generated.
@ -251,7 +251,7 @@ var PromiseTestUtils = {
continue;
}
// Check the global whitelisting functions.
// Check the global ignore functions.
if (this._globalRejectionIgnoreFns.some(fn => fn(rejection))) {
continue;
}

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

@ -6,7 +6,7 @@
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
// Whitelist rejections related to closing an about:debugging too soon after it has been
// Allow rejections related to closing an about:debugging too soon after it has been
// just opened in a new tab and loaded.
PromiseTestUtils.allowMatchingRejectionsGlobally(/Connection closed/);