From 1f31f996f6739ad32a27a113415929b7e10d6b49 Mon Sep 17 00:00:00 2001 From: Brian Hackett Date: Thu, 19 Sep 2019 17:32:18 +0000 Subject: [PATCH] Bug 1582057 - Whitelist exceptions from canceled operations in debugger tests, r=jlast. Differential Revision: https://phabricator.services.mozilla.com/D46345 --HG-- extra : moz-landing-system : lando --- .../test/mochitest/browser_dbg-chrome-create.js | 3 --- .../test/mochitest/browser_dbg-editor-gutter.js | 3 --- .../test/mochitest/browser_dbg-inline-cache.js | 6 ------ .../mochitest/browser_dbg-inline-script-offset.js | 6 ------ .../browser_dbg-remember-expanded-scopes.js | 3 --- .../debugger/test/mochitest/browser_dbg-stepping.js | 6 ------ .../debugger/test/mochitest/browser_dbg-tabs.js | 6 ------ .../mochitest/browser_dbg-windowless-workers.js | 9 --------- .../test/mochitest/browser_dbg-worker-scopes.js | 3 --- devtools/client/debugger/test/mochitest/helpers.js | 13 +++++++++++++ .../shared/test/browser_dbg_worker-console-04.js | 3 --- .../browser_webconsole_location_debugger_link.js | 3 --- ..._webconsole_stacktrace_location_debugger_link.js | 3 --- devtools/client/webreplay/mochitest/head.js | 9 --------- 14 files changed, 13 insertions(+), 63 deletions(-) diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-chrome-create.js b/devtools/client/debugger/test/mochitest/browser_dbg-chrome-create.js index b51d23749c27..9e64cd0ff33f 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-chrome-create.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-chrome-create.js @@ -7,9 +7,6 @@ // There are shutdown issues for which multiple rejections are left uncaught. // See bug 1018184 for resolving these issues. -const { PromiseTestUtils } = ChromeUtils.import( - "resource://testing-common/PromiseTestUtils.jsm" -); PromiseTestUtils.whitelistRejectionsGlobally(/File closed/); PromiseTestUtils.whitelistRejectionsGlobally(/NS_ERROR_FAILURE/); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-editor-gutter.js b/devtools/client/debugger/test/mochitest/browser_dbg-editor-gutter.js index f9cff0f31480..57868f1ab0ec 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-editor-gutter.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-editor-gutter.js @@ -7,9 +7,6 @@ // FIXME bug 1524374 removing breakpoints in this test can cause uncaught // rejections and make bug 1512742 permafail. -const { PromiseTestUtils } = ChromeUtils.import( - "resource://testing-common/PromiseTestUtils.jsm" -); PromiseTestUtils.whitelistRejectionsGlobally(/NS_ERROR_NOT_INITIALIZED/); // Utilities for interacting with the editor diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-inline-cache.js b/devtools/client/debugger/test/mochitest/browser_dbg-inline-cache.js index a6a06fe5da57..d1d3b23d51b4 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-inline-cache.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-inline-cache.js @@ -10,12 +10,6 @@ * - Reload inside debugger with toolbox caching enabled */ -// Debugger operations may still be in progress when we navigate. -const { PromiseTestUtils } = ChromeUtils.import( - "resource://testing-common/PromiseTestUtils.jsm" -); -PromiseTestUtils.whitelistRejectionsGlobally(/Page has navigated/); - const server = createTestHTTPServer(); let docValue = 1; diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-inline-script-offset.js b/devtools/client/debugger/test/mochitest/browser_dbg-inline-script-offset.js index df1d2cc908ad..0829297faf60 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-inline-script-offset.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-inline-script-offset.js @@ -6,12 +6,6 @@ // Test that breakpoints work when set in inline scripts that do not start at column 0. -// Debugger operations may still be in progress when we navigate. -const { PromiseTestUtils } = ChromeUtils.import( - "resource://testing-common/PromiseTestUtils.jsm" -); -PromiseTestUtils.whitelistRejectionsGlobally(/Page has navigated/); - add_task(async function() { const dbg = await initDebugger("doc-inline-script-offset.html"); await addBreakpoint(dbg, "doc-inline-script-offset.html", 6, 66); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-remember-expanded-scopes.js b/devtools/client/debugger/test/mochitest/browser_dbg-remember-expanded-scopes.js index 7e29edd8fd35..cd20fa01127b 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-remember-expanded-scopes.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-remember-expanded-scopes.js @@ -3,9 +3,6 @@ * file, You can obtain one at . */ // Ignore strange errors when shutting down. -const { PromiseTestUtils } = ChromeUtils.import( - "resource://testing-common/PromiseTestUtils.jsm" -); PromiseTestUtils.whitelistRejectionsGlobally(/No such actor/); PromiseTestUtils.whitelistRejectionsGlobally(/connection just closed/); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-stepping.js b/devtools/client/debugger/test/mochitest/browser_dbg-stepping.js index 32830e63e92c..3393df4d6276 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-stepping.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-stepping.js @@ -5,12 +5,6 @@ // This test can be really slow on debug platforms requestLongerTimeout(5); -// Debugger operations may still be in progress when we step. -const { PromiseTestUtils } = ChromeUtils.import( - "resource://testing-common/PromiseTestUtils.jsm" -); -PromiseTestUtils.whitelistRejectionsGlobally(/Current thread has paused or resumed/); - add_task(async function test() { const dbg = await initDebugger("big-sourcemap.html", "big-sourcemap"); invokeInTab("hitDebugStatement"); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-tabs.js b/devtools/client/debugger/test/mochitest/browser_dbg-tabs.js index 577b9b7c9c3a..7f80adee4dca 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-tabs.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-tabs.js @@ -3,12 +3,6 @@ // Tests adding and removing tabs -// Debugger operations may still be in progress when we navigate. -const { PromiseTestUtils } = ChromeUtils.import( - "resource://testing-common/PromiseTestUtils.jsm" -); -PromiseTestUtils.whitelistRejectionsGlobally(/Page has navigated/); - add_task(async function() { const dbg = await initDebugger("doc-scripts.html", "simple1", "simple2"); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-windowless-workers.js b/devtools/client/debugger/test/mochitest/browser_dbg-windowless-workers.js index acd78ae89950..b5be3c1099d6 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-windowless-workers.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-windowless-workers.js @@ -2,15 +2,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ -// Debugger operations may still be in progress when we switch threads. -const { PromiseTestUtils } = ChromeUtils.import( - "resource://testing-common/PromiseTestUtils.jsm" -); -PromiseTestUtils.whitelistRejectionsGlobally( - /Current thread has paused or resumed/ -); -PromiseTestUtils.whitelistRejectionsGlobally(/Current thread has changed/); - function assertClass(dbg, selector, className, ...args) { ok( findElement(dbg, selector, ...args).classList.contains(className), diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-worker-scopes.js b/devtools/client/debugger/test/mochitest/browser_dbg-worker-scopes.js index 63dcb3a4d17c..176b8e5c7ef6 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-worker-scopes.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-worker-scopes.js @@ -5,9 +5,6 @@ // This error shows up sometimes when running the test, and while this is a // strange problem that shouldn't be happening it doesn't prevent the test from // completing successfully. -const { PromiseTestUtils } = ChromeUtils.import( - "resource://testing-common/PromiseTestUtils.jsm" -); PromiseTestUtils.whitelistRejectionsGlobally(/Current state is running/); function findNode(dbg, text) { diff --git a/devtools/client/debugger/test/mochitest/helpers.js b/devtools/client/debugger/test/mochitest/helpers.js index 634ded32bc00..4febf4ea5039 100644 --- a/devtools/client/debugger/test/mochitest/helpers.js +++ b/devtools/client/debugger/test/mochitest/helpers.js @@ -1832,3 +1832,16 @@ function evaluateExpressionInConsole(hud, expression) { function waitForInspectorPanelChange(dbg) { return dbg.toolbox.getPanelWhenReady("inspector"); } + +const { PromiseTestUtils } = ChromeUtils.import( + "resource://testing-common/PromiseTestUtils.jsm" +); + +// 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( + /Current thread has paused or resumed/ +); diff --git a/devtools/client/shared/test/browser_dbg_worker-console-04.js b/devtools/client/shared/test/browser_dbg_worker-console-04.js index a90143e67945..b6ff23ca8f91 100644 --- a/devtools/client/shared/test/browser_dbg_worker-console-04.js +++ b/devtools/client/shared/test/browser_dbg_worker-console-04.js @@ -19,9 +19,6 @@ Services.scriptloader.loadSubScript( // There are shutdown issues for which multiple rejections are left uncaught. // See bug 1018184 for resolving these issues. -const { PromiseTestUtils } = ChromeUtils.import( - "resource://testing-common/PromiseTestUtils.jsm" -); PromiseTestUtils.whitelistRejectionsGlobally(/connection just closed/); const TAB_URL = EXAMPLE_URL + "doc_WorkerTargetActor.attachThread-tab.html"; diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_location_debugger_link.js b/devtools/client/webconsole/test/browser/browser_webconsole_location_debugger_link.js index e7c5393f0048..6987e4587612 100644 --- a/devtools/client/webconsole/test/browser/browser_webconsole_location_debugger_link.js +++ b/devtools/client/webconsole/test/browser/browser_webconsole_location_debugger_link.js @@ -8,9 +8,6 @@ // There are shutdown issues for which multiple rejections are left uncaught. // See bug 1018184 for resolving these issues. -const { PromiseTestUtils } = ChromeUtils.import( - "resource://testing-common/PromiseTestUtils.jsm" -); PromiseTestUtils.whitelistRejectionsGlobally(/this\.worker is null/); requestLongerTimeout(2); diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_stacktrace_location_debugger_link.js b/devtools/client/webconsole/test/browser/browser_webconsole_stacktrace_location_debugger_link.js index b3887ca6b4c2..5cae5fef1ee5 100644 --- a/devtools/client/webconsole/test/browser/browser_webconsole_stacktrace_location_debugger_link.js +++ b/devtools/client/webconsole/test/browser/browser_webconsole_stacktrace_location_debugger_link.js @@ -8,9 +8,6 @@ // There are shutdown issues for which multiple rejections are left uncaught. // See bug 1018184 for resolving these issues. -const { PromiseTestUtils } = ChromeUtils.import( - "resource://testing-common/PromiseTestUtils.jsm" -); PromiseTestUtils.whitelistRejectionsGlobally(/Component not initialized/); PromiseTestUtils.whitelistRejectionsGlobally(/this\.worker is null/); diff --git a/devtools/client/webreplay/mochitest/head.js b/devtools/client/webreplay/mochitest/head.js index 3fd797665d78..54a0ac20b2e2 100644 --- a/devtools/client/webreplay/mochitest/head.js +++ b/devtools/client/webreplay/mochitest/head.js @@ -229,18 +229,9 @@ async function checkMessageObjectContents(msg, expected, expandList = []) { }); } -const { PromiseTestUtils } = ChromeUtils.import( - "resource://testing-common/PromiseTestUtils.jsm" -); PromiseTestUtils.whitelistRejectionsGlobally(/NS_ERROR_NOT_INITIALIZED/); PromiseTestUtils.whitelistRejectionsGlobally(/Error in asyncStorage/); -// Many web replay tests can resume execution before the debugger has finished -// all operations related to the pause. -PromiseTestUtils.whitelistRejectionsGlobally( - /Current thread has paused or resumed/ -); - // When running the full test suite, long delays can occur early on in tests, // before child processes have even been spawned. Allow a longer timeout to // avoid failures from this.