diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
commit | 8dd16259287f58f9273002717ec4d27e97127719 (patch) | |
tree | 3863e62a53829a84037444beab3abd4ed9dfc7d0 /toolkit/components/contentrelevancy/tests/xpcshell/test_ContentRelevancyManager.js | |
parent | Releasing progress-linux version 126.0.1-1~progress7.99u1. (diff) | |
download | firefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz firefox-8dd16259287f58f9273002717ec4d27e97127719.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.js | 28 |
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 |