diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /docshell/test/unit/test_URIFixup.js | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'docshell/test/unit/test_URIFixup.js')
-rw-r--r-- | docshell/test/unit/test_URIFixup.js | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/docshell/test/unit/test_URIFixup.js b/docshell/test/unit/test_URIFixup.js index 794ee8cfa2..54e717244d 100644 --- a/docshell/test/unit/test_URIFixup.js +++ b/docshell/test/unit/test_URIFixup.js @@ -1,3 +1,7 @@ +const { PromiseTestUtils } = ChromeUtils.importESModule( + "resource://testing-common/PromiseTestUtils.sys.mjs" +); + var pref = "browser.fixup.typo.scheme"; var data = [ @@ -103,11 +107,20 @@ var dontFixURIs = [ var len = data.length; add_task(async function setup() { - await setupSearchService(); - // Now we've initialised the search service, we force remove the engines - // it has, so they don't interfere with this test. + // Force search service to fail, so we do not have any engines that can + // interfere with this test. // Search engine integration is tested in test_URIFixup_search.js. - Services.search.wrappedJSObject._engines.clear(); + Services.search.wrappedJSObject.errorToThrowInTest = "Settings"; + + // When search service fails, we want the promise rejection to be uncaught + // so we can continue running the test. + PromiseTestUtils.expectUncaughtRejection( + /Fake Settings error during search service initialization./ + ); + + try { + await setupSearchService(); + } catch {} }); // Make sure we fix what needs fixing when there is no pref set. |