Bug 1650155 - Rename PromiseTestUtils.whitelistRejectionsGlobally to allowMatchingRejectionsGlobally r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D82059
This commit is contained in:
Julian Descottes 2020-07-03 17:01:29 +00:00
parent e17ca5f1b5
commit 3e1e4c22b6
57 changed files with 102 additions and 72 deletions

View File

@ -11,7 +11,7 @@ SimpleTest.ignoreAllUncaughtExceptions(true);
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
PromiseTestUtils.whitelistRejectionsGlobally(/Not in fullscreen mode/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/Not in fullscreen mode/);
SimpleTest.requestCompleteLog();

View File

@ -13,7 +13,7 @@ const PERMISSIONS_PAGE =
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
PromiseTestUtils.whitelistRejectionsGlobally(/The request is not allowed/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/The request is not allowed/);
const EXPIRE_TIME_MS = 100;
const TIMEOUT_MS = 500;

View File

@ -84,7 +84,7 @@ add_task(async function testWithRange() {
// We have intermittent occurrences of NS_ERROR_ABORT being
// thrown at closing database instances when using Santizer.sanitize().
// This does not seem to impact cleanup, since our tests run fine anyway.
PromiseTestUtils.whitelistRejectionsGlobally(/NS_ERROR_ABORT/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/NS_ERROR_ABORT/);
await SpecialPowers.pushPrefEnv({
set: [

View File

@ -9,7 +9,7 @@
// NOTE: Whitelisting a class of rejections should be limited. Normally you
// should use "expectUncaughtRejection" to flag individual failures.
ChromeUtils.import("resource://testing-common/PromiseTestUtils.jsm", this);
PromiseTestUtils.whitelistRejectionsGlobally(/aborted by the user agent/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/aborted by the user agent/);
ChromeUtils.import("resource:///modules/BrowserWindowTracker.jsm", this);
const permissionError =

View File

@ -2,7 +2,7 @@
/* vim: set sts=2 sw=2 et tw=80: */
"use strict";
PromiseTestUtils.whitelistRejectionsGlobally(/packaging errors/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/packaging errors/);
// Test that an error is thrown when providing invalid icon sizes
add_task(async function testInvalidIconSizes() {

View File

@ -2,7 +2,7 @@
/* vim: set sts=2 sw=2 et tw=80: */
"use strict";
PromiseTestUtils.whitelistRejectionsGlobally(/packaging errors/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/packaging errors/);
const { GlobalManager } = ChromeUtils.import(
"resource://gre/modules/Extension.jsm",

View File

@ -2,7 +2,7 @@
/* vim: set sts=2 sw=2 et tw=80: */
"use strict";
PromiseTestUtils.whitelistRejectionsGlobally(/packaging errors/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/packaging errors/);
function getExtension(page_action) {
return ExtensionTestUtils.loadExtension({

View File

@ -1,6 +1,6 @@
"use strict";
PromiseTestUtils.whitelistRejectionsGlobally(/packaging errors/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/packaging errors/);
/**
* Helper function for testing a theme with invalid properties.

View File

@ -39,9 +39,13 @@
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
PromiseTestUtils.whitelistRejectionsGlobally(/Message manager disconnected/);
PromiseTestUtils.whitelistRejectionsGlobally(/No matching message handler/);
PromiseTestUtils.whitelistRejectionsGlobally(/Receiving end does not exist/);
PromiseTestUtils.allowMatchingRejectionsGlobally(
/Message manager disconnected/
);
PromiseTestUtils.allowMatchingRejectionsGlobally(/No matching message handler/);
PromiseTestUtils.allowMatchingRejectionsGlobally(
/Receiving end does not exist/
);
const { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm"

View File

@ -32,7 +32,7 @@ ChromeUtils.import("resource:///modules/sessionstore/SessionStartup.jsm", this);
// NOTE: Whitelisting a class of rejections should be limited. Normally you
// should use "expectUncaughtRejection" to flag individual failures.
ChromeUtils.import("resource://testing-common/PromiseTestUtils.jsm", this);
PromiseTestUtils.whitelistRejectionsGlobally(/getTopWindow/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/getTopWindow/);
// Some urls that might be opened in tabs and/or popups
// Do not use about:blank:

View File

@ -40,8 +40,8 @@ add_task(async function setup() {
// AddonManager shuts down BrowserGlue will then try to uninit which will
// cause AutoComplete.jsm to throw an error.
// TODO: Fix in https://bugzilla.mozilla.org/show_bug.cgi?id=1543112.
PromiseTestUtils.whitelistRejectionsGlobally(/A request was aborted/);
PromiseTestUtils.whitelistRejectionsGlobally(
PromiseTestUtils.allowMatchingRejectionsGlobally(/A request was aborted/);
PromiseTestUtils.allowMatchingRejectionsGlobally(
/The operation failed for reasons unrelated/
);

View File

@ -12,7 +12,7 @@
// NOTE: Whitelisting a class of rejections should be limited. Normally you
// should use "expectUncaughtRejection" to flag individual failures.
ChromeUtils.import("resource://testing-common/PromiseTestUtils.jsm", this);
PromiseTestUtils.whitelistRejectionsGlobally(/NS_ERROR_ILLEGAL_VALUE/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/NS_ERROR_ILLEGAL_VALUE/);
const kEnginePref = "browser.translation.engine";
const kApiKeyPref = "browser.translation.yandex.apiKeyOverride";

View File

@ -10,7 +10,7 @@ Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this);
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
PromiseTestUtils.whitelistRejectionsGlobally(/File closed/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/File closed/);
// Avoid test timeouts that can occur while waiting for the "addon-console-works" message.
requestLongerTimeout(2);

View File

@ -10,7 +10,7 @@ Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this);
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
PromiseTestUtils.whitelistRejectionsGlobally(/File closed/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/File closed/);
// Avoid test timeouts that can occur while waiting for the "addon-console-works" message.
requestLongerTimeout(2);

View File

@ -10,7 +10,7 @@ Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this);
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
PromiseTestUtils.whitelistRejectionsGlobally(/File closed/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/File closed/);
const ADDON_NOBG_ID = "test-devtools-webextension-nobg@mozilla.org";
const ADDON_NOBG_NAME = "test-devtools-webextension-nobg";

View File

@ -10,7 +10,7 @@ Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this);
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
PromiseTestUtils.whitelistRejectionsGlobally(/File closed/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/File closed/);
// Avoid test timeouts that can occur while waiting for the "addon-console-works" message.
requestLongerTimeout(2);

View File

@ -39,7 +39,7 @@ async function enableApplicationPanel() {
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
PromiseTestUtils.whitelistRejectionsGlobally(
PromiseTestUtils.allowMatchingRejectionsGlobally(
/this._frontCreationListeners is null/
);

View File

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
PromiseTestUtils.whitelistRejectionsGlobally(/Connection closed/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/Connection closed/);
// Test that sources appear in the debugger when navigating using the BFCache.
add_task(async function() {

View File

@ -3,7 +3,7 @@
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
// Ignore strange errors when shutting down.
PromiseTestUtils.whitelistRejectionsGlobally(/No such actor/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/No such actor/);
add_task(async function() {
const dbg = await initDebugger("doc-script-switching.html");

View File

@ -9,8 +9,8 @@
// There are shutdown issues for which multiple rejections are left uncaught.
// See bug 1018184 for resolving these issues.
PromiseTestUtils.whitelistRejectionsGlobally(/File closed/);
PromiseTestUtils.whitelistRejectionsGlobally(/NS_ERROR_FAILURE/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/File closed/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/NS_ERROR_FAILURE/);
requestLongerTimeout(5);

View File

@ -7,7 +7,7 @@
// FIXME bug 1524374 removing breakpoints in this test can cause uncaught
// rejections and make bug 1512742 permafail.
PromiseTestUtils.whitelistRejectionsGlobally(/NS_ERROR_NOT_INITIALIZED/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/NS_ERROR_NOT_INITIALIZED/);
add_task(async function() {
const dbg = await initDebugger("doc-scripts.html", "simple1.js");

View File

@ -12,7 +12,7 @@
*/
// Breakpoint position calculations can throw when interrupted by a navigation.
PromiseTestUtils.whitelistRejectionsGlobally(/Resource .*? does not exist/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/Resource .*? does not exist/);
const server = createTestHTTPServer();

View File

@ -3,8 +3,8 @@
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
// Ignore strange errors when shutting down.
PromiseTestUtils.whitelistRejectionsGlobally(/No such actor/);
PromiseTestUtils.whitelistRejectionsGlobally(/connection just closed/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/No such actor/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/connection just closed/);
const MAXIMUM_ITEMS = 10;

View File

@ -2,8 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
PromiseTestUtils.whitelistRejectionsGlobally(/Current state is running/);
PromiseTestUtils.whitelistRejectionsGlobally(/Connection closed/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/Current state is running/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/Connection closed/);
// Test that unusual objects have their contents shown in worker thread scopes.
add_task(async function() {

View File

@ -2016,9 +2016,9 @@ 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.
PromiseTestUtils.whitelistRejectionsGlobally(/Page has navigated/);
PromiseTestUtils.whitelistRejectionsGlobally(/Current thread has changed/);
PromiseTestUtils.whitelistRejectionsGlobally(
PromiseTestUtils.allowMatchingRejectionsGlobally(/Page has navigated/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/Current thread has changed/);
PromiseTestUtils.allowMatchingRejectionsGlobally(
/Current thread has paused or resumed/
);
PromiseTestUtils.whitelistRejectionsGlobally(/Connection closed/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/Connection closed/);

View File

@ -6,7 +6,7 @@
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
PromiseTestUtils.whitelistRejectionsGlobally(/File closed/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/File closed/);
// On debug test machine, it takes about 50s to run the test.
requestLongerTimeout(4);

View File

@ -8,7 +8,7 @@
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
PromiseTestUtils.whitelistRejectionsGlobally(/File closed/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/File closed/);
// On debug test runner, it takes about 50s to run the test.
requestLongerTimeout(4);

View File

@ -6,7 +6,7 @@
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
PromiseTestUtils.whitelistRejectionsGlobally(/File closed/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/File closed/);
/* import-globals-from ../../../inspector/test/shared-head.js */
Services.scriptloader.loadSubScript(

View File

@ -6,7 +6,7 @@
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
PromiseTestUtils.whitelistRejectionsGlobally(/File closed/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/File closed/);
// On debug test machine, it takes about 50s to run the test.
requestLongerTimeout(4);

View File

@ -6,7 +6,7 @@
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
PromiseTestUtils.whitelistRejectionsGlobally(/File closed/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/File closed/);
// On debug test machine, it takes about 50s to run the test.
requestLongerTimeout(4);

View File

@ -50,7 +50,7 @@ async function initBrowserToolboxTask({
// This rejection seems to affect all tests using the browser toolbox.
ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
).PromiseTestUtils.whitelistRejectionsGlobally(/File closed/);
).PromiseTestUtils.allowMatchingRejectionsGlobally(/File closed/);
const process = await new Promise(onRun => {
BrowserToolboxLauncher.init(null, onRun, /* overwritePreferences */ true);

View File

@ -14,8 +14,8 @@
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
PromiseTestUtils.whitelistRejectionsGlobally(/this\.worker is null/);
PromiseTestUtils.whitelistRejectionsGlobally(/Component not initialized/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/this\.worker is null/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/Component not initialized/);
// Empty page
const PAGE_URL = `${URL_ROOT}doc_empty-tab-01.html`;

View File

@ -10,7 +10,7 @@
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
PromiseTestUtils.whitelistRejectionsGlobally(/this\.worker is null/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/this\.worker is null/);
// Empty page
const PAGE_URL = `${URL_ROOT}doc_empty-tab-01.html`;

View File

@ -10,8 +10,8 @@
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
PromiseTestUtils.whitelistRejectionsGlobally(/this\.worker is null/);
PromiseTestUtils.whitelistRejectionsGlobally(/Component not initialized/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/this\.worker is null/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/Component not initialized/);
const TEST_ROOT = "http://example.com/browser/devtools/client/framework/test/";
// Empty page

View File

@ -14,7 +14,7 @@ const { PromiseTestUtils } = ChromeUtils.import(
);
// 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...
PromiseTestUtils.whitelistRejectionsGlobally(/Page has navigated/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/Page has navigated/);
const TEST_URL =
"data:text/html;charset=utf-8," +

View File

@ -10,7 +10,7 @@
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
PromiseTestUtils.whitelistRejectionsGlobally(/Connection closed/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/Connection closed/);
const { Toolbox } = require("devtools/client/framework/toolbox");

View File

@ -10,7 +10,7 @@
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
PromiseTestUtils.whitelistRejectionsGlobally(/Connection closed/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/Connection closed/);
add_task(async function() {
await addTab(`data:text/html;charset=utf-8,

View File

@ -8,8 +8,8 @@
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
PromiseTestUtils.whitelistRejectionsGlobally(/Component not initialized/);
PromiseTestUtils.whitelistRejectionsGlobally(/Connection closed/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/Component not initialized/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/Connection closed/);
/**
* Tests if on clicking the stack frame, UI switches to the Debugger panel.

View File

@ -12,8 +12,12 @@ const TEST_URL = "http://example.com/";
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
PromiseTestUtils.whitelistRejectionsGlobally(/Message manager disconnected/);
PromiseTestUtils.whitelistRejectionsGlobally(/Receiving end does not exist/);
PromiseTestUtils.allowMatchingRejectionsGlobally(
/Message manager disconnected/
);
PromiseTestUtils.allowMatchingRejectionsGlobally(
/Receiving end does not exist/
);
const extension = ExtensionTestUtils.loadExtension({
manifest: {

View File

@ -8,7 +8,7 @@
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
PromiseTestUtils.whitelistRejectionsGlobally(
PromiseTestUtils.allowMatchingRejectionsGlobally(
/Permission denied to access property "document" on cross-origin object/
);

View File

@ -19,7 +19,7 @@ Services.scriptloader.loadSubScript(
// There are shutdown issues for which multiple rejections are left uncaught.
// See bug 1018184 for resolving these issues.
PromiseTestUtils.whitelistRejectionsGlobally(/connection just closed/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/connection just closed/);
const TAB_URL = EXAMPLE_URL + "doc_WorkerTargetActor.attachThread-tab.html";
const WORKER_URL = "code_WorkerTargetActor.attachThread-worker.js";

View File

@ -8,7 +8,7 @@
// There are shutdown issues for which multiple rejections are left uncaught.
// See bug 1018184 for resolving these issues.
PromiseTestUtils.whitelistRejectionsGlobally(/this\.worker is null/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/this\.worker is null/);
requestLongerTimeout(2);

View File

@ -8,8 +8,8 @@
// There are shutdown issues for which multiple rejections are left uncaught.
// See bug 1018184 for resolving these issues.
PromiseTestUtils.whitelistRejectionsGlobally(/Component not initialized/);
PromiseTestUtils.whitelistRejectionsGlobally(/this\.worker is null/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/Component not initialized/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/this\.worker is null/);
const TEST_URI =
"http://example.com/browser/devtools/client/webconsole/" +

View File

@ -23,7 +23,9 @@ const {
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
PromiseTestUtils.whitelistRejectionsGlobally(/Message manager disconnected/);
PromiseTestUtils.allowMatchingRejectionsGlobally(
/Message manager disconnected/
);
const { createAppInfo, promiseStartupManager } = AddonTestUtils;

View File

@ -26,7 +26,9 @@ const {
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
PromiseTestUtils.whitelistRejectionsGlobally(/Message manager disconnected/);
PromiseTestUtils.allowMatchingRejectionsGlobally(
/Message manager disconnected/
);
const { createAppInfo, promiseStartupManager } = AddonTestUtils;

View File

@ -3,7 +3,7 @@ let JSMPromise = ChromeUtils.import("resource://gre/modules/Promise.jsm", {})
.Promise;
ChromeUtils.import("resource://testing-common/PromiseTestUtils.jsm", this);
PromiseTestUtils.whitelistRejectionsGlobally(/Whitelisted rejection./);
PromiseTestUtils.allowRejectionsGlobally(/Whitelisted rejection./);
PromiseTestUtils.expectUncaughtRejection(/Promise.jsm rejection./);
PromiseTestUtils.expectUncaughtRejection(/Promise.jsm rejection./);
PromiseTestUtils.expectUncaughtRejection(/Promise rejection./);

View File

@ -5,7 +5,9 @@
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
PromiseTestUtils.whitelistRejectionsGlobally(/Message manager disconnected/);
PromiseTestUtils.allowMatchingRejectionsGlobally(
/Message manager disconnected/
);
add_task(async function test_management_themes() {
const TEST_ID = "test_management_themes@tests.mozilla.com";

View File

@ -37,7 +37,9 @@ XPCOMUtils.defineLazyModuleGetters(this, {
Schemas: "resource://gre/modules/Schemas.jsm",
});
PromiseTestUtils.whitelistRejectionsGlobally(/Message manager disconnected/);
PromiseTestUtils.allowMatchingRejectionsGlobally(
/Message manager disconnected/
);
// These values may be changed in later head files and tested in check_remote
// below.

View File

@ -4,7 +4,9 @@ const { ExtensionStorageIDB } = ChromeUtils.import(
"resource://gre/modules/ExtensionStorageIDB.jsm"
);
PromiseTestUtils.whitelistRejectionsGlobally(/WebExtension context not found/);
PromiseTestUtils.allowMatchingRejectionsGlobally(
/WebExtension context not found/
);
const server = createHttpServer({ hosts: ["example.com"] });
server.registerDirectory("/data/", do_get_file("data"));

View File

@ -2,7 +2,9 @@
Services.prefs.setBoolPref("webextensions.storage.sync.kinto", false);
PromiseTestUtils.whitelistRejectionsGlobally(/WebExtension context not found/);
PromiseTestUtils.allowMatchingRejectionsGlobally(
/WebExtension context not found/
);
const server = createHttpServer({ hosts: ["example.com"] });
server.registerDirectory("/data/", do_get_file("data"));

View File

@ -2,7 +2,9 @@
Services.prefs.setBoolPref("webextensions.storage.sync.kinto", true);
PromiseTestUtils.whitelistRejectionsGlobally(/WebExtension context not found/);
PromiseTestUtils.allowMatchingRejectionsGlobally(
/WebExtension context not found/
);
const server = createHttpServer({ hosts: ["example.com"] });
server.registerDirectory("/data/", do_get_file("data"));

View File

@ -213,14 +213,14 @@ var PromiseTestUtils = {
},
/**
* Whitelists an entire class of Promise rejections. Usage of this function
* Allows an entire class of Promise rejections. Usage of this function
* should be kept to a minimum because it has a broad scope and doesn't
* prevent new unhandled rejections of this class from being added.
*
* @param regExp
* This should match the error message of the rejection.
*/
whitelistRejectionsGlobally(regExp) {
allowMatchingRejectionsGlobally(regExp) {
this._globalRejectionIgnoreFns.push(rejection =>
regExp.test(rejection.message)
);

View File

@ -8,7 +8,7 @@ const { PromiseTestUtils } = ChromeUtils.import(
);
// Whitelist rejections related to closing an about:debugging too soon after it has been
// just opened in a new tab and loaded.
PromiseTestUtils.whitelistRejectionsGlobally(/Connection closed/);
PromiseTestUtils.allowMatchingRejectionsGlobally(/Connection closed/);
function waitForDispatch(store, type) {
return new Promise(resolve => {

View File

@ -3,7 +3,9 @@
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
PromiseTestUtils.whitelistRejectionsGlobally(/Message manager disconnected/);
PromiseTestUtils.allowMatchingRejectionsGlobally(
/Message manager disconnected/
);
function extensionShortcutsReady(id) {
let extension = WebExtensionPolicy.getByID(id).extension;

View File

@ -3,7 +3,9 @@
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
PromiseTestUtils.whitelistRejectionsGlobally(/Message manager disconnected/);
PromiseTestUtils.allowMatchingRejectionsGlobally(
/Message manager disconnected/
);
async function loadShortcutsView() {
let win = await loadInitialView("extension");

View File

@ -14,7 +14,9 @@ if (AppConstants.platform == "win" && AppConstants.DEBUG) {
Services.prefs.setBoolPref("extensions.webextensions.remote", false);
}
PromiseTestUtils.whitelistRejectionsGlobally(/Message manager disconnected/);
PromiseTestUtils.allowMatchingRejectionsGlobally(
/Message manager disconnected/
);
/* globals browser*/

View File

@ -4,7 +4,9 @@
// This verifies that delaying a system add-on update works.
PromiseTestUtils.whitelistRejectionsGlobally(/Message manager disconnected/);
PromiseTestUtils.allowMatchingRejectionsGlobally(
/Message manager disconnected/
);
const profileDir = gProfD.clone();
profileDir.append("extensions");