summaryrefslogtreecommitdiffstats
path: root/toolkit/components/contentrelevancy/tests/xpcshell/test_ContentRelevancyManager.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
commita90a5cba08fdf6c0ceb95101c275108a152a3aed (patch)
tree532507288f3defd7f4dcf1af49698bcb76034855 /toolkit/components/contentrelevancy/tests/xpcshell/test_ContentRelevancyManager.js
parentAdding debian version 126.0.1-1. (diff)
downloadfirefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz
firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/contentrelevancy/tests/xpcshell/test_ContentRelevancyManager.js')
-rw-r--r--toolkit/components/contentrelevancy/tests/xpcshell/test_ContentRelevancyManager.js28
1 files changed, 5 insertions, 23 deletions
diff --git a/toolkit/components/contentrelevancy/tests/xpcshell/test_ContentRelevancyManager.js b/toolkit/components/contentrelevancy/tests/xpcshell/test_ContentRelevancyManager.js
index 633f9fc49b..7f89c7d615 100644
--- a/toolkit/components/contentrelevancy/tests/xpcshell/test_ContentRelevancyManager.js
+++ b/toolkit/components/contentrelevancy/tests/xpcshell/test_ContentRelevancyManager.js
@@ -23,11 +23,11 @@ const CATEGORY_UPDATE_TIMER = "update-timer";
let gSandbox;
-add_setup(async () => {
+add_setup(() => {
gSandbox = sinon.createSandbox();
initUpdateTimerManager();
Services.prefs.setBoolPref(PREF_CONTENT_RELEVANCY_ENABLED, true);
- await ContentRelevancyManager.init();
+ ContentRelevancyManager.init();
registerCleanupFunction(() => {
Services.prefs.clearUserPref(PREF_CONTENT_RELEVANCY_ENABLED);
@@ -35,11 +35,11 @@ add_setup(async () => {
});
});
-add_task(async function test_init() {
+add_task(function test_init() {
Assert.ok(ContentRelevancyManager.initialized, "Init should succeed");
});
-add_task(async function test_uninit() {
+add_task(function test_uninit() {
ContentRelevancyManager.uninit();
Assert.ok(!ContentRelevancyManager.initialized, "Uninit should succeed");
@@ -50,7 +50,7 @@ add_task(async function test_timer() {
Services.prefs.setIntPref(PREF_TIMER_INTERVAL, 0);
gSandbox.spy(ContentRelevancyManager, "notify");
- await ContentRelevancyManager.init();
+ ContentRelevancyManager.init();
await TestUtils.waitForCondition(
() => ContentRelevancyManager.notify.called,
@@ -100,24 +100,6 @@ add_task(async function test_call_disable_twice() {
Services.prefs.clearUserPref(PREF_CONTENT_RELEVANCY_ENABLED);
});
-add_task(async function test_doClassification() {
- Services.prefs.setBoolPref(PREF_CONTENT_RELEVANCY_ENABLED, true);
- await TestUtils.waitForCondition(() => ContentRelevancyManager._isStoreReady);
- await ContentRelevancyManager._test_doClassification([]);
-
- // Disable it to reset the store.
- Services.prefs.setBoolPref(PREF_CONTENT_RELEVANCY_ENABLED, false);
- await TestUtils.waitForTick();
-
- await Assert.rejects(
- ContentRelevancyManager._test_doClassification([]),
- /Store is not available/,
- "Should throw with an unset store"
- );
-
- Services.prefs.clearUserPref(PREF_CONTENT_RELEVANCY_ENABLED);
-});
-
/**
* Sets up the update timer manager for testing: makes it fire more often,
* removes all existing timers, and initializes it for testing. The body of this