diff options
Diffstat (limited to 'toolkit/components/places/tests/unit/test_frecency_recalculator.js')
-rw-r--r-- | toolkit/components/places/tests/unit/test_frecency_recalculator.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/toolkit/components/places/tests/unit/test_frecency_recalculator.js b/toolkit/components/places/tests/unit/test_frecency_recalculator.js index ed4501c56a..414882eaf5 100644 --- a/toolkit/components/places/tests/unit/test_frecency_recalculator.js +++ b/toolkit/components/places/tests/unit/test_frecency_recalculator.js @@ -176,3 +176,19 @@ add_task(async function test_chunk_time_telemetry() { "Should still not have set shouldStartFrecencyRecalculation" ); }); + +add_task(async function test_acceleration() { + await PlacesTestUtils.addVisits( + new Array(300).fill("https://www.mozilla.org/") + ); + + Assert.ok( + PlacesFrecencyRecalculator.maybeUpdateRecalculationSpeed(), + "Recalculation accelerated" + ); + await PlacesFrecencyRecalculator.recalculateAnyOutdatedFrecencies(); + Assert.ok( + !PlacesFrecencyRecalculator.maybeUpdateRecalculationSpeed(), + "Recalculation back to normal rate" + ); +}); |