summaryrefslogtreecommitdiffstats
path: root/docshell/test/unit/test_URIFixup.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /docshell/test/unit/test_URIFixup.js
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 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.js21
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.