summaryrefslogtreecommitdiffstats
path: root/browser/components/urlbar/tests/unit/head.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /browser/components/urlbar/tests/unit/head.js
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-adbda400be353e676059e335c3c0aaf99e719475.tar.xz
firefox-adbda400be353e676059e335c3c0aaf99e719475.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/urlbar/tests/unit/head.js')
-rw-r--r--browser/components/urlbar/tests/unit/head.js33
1 files changed, 1 insertions, 32 deletions
diff --git a/browser/components/urlbar/tests/unit/head.js b/browser/components/urlbar/tests/unit/head.js
index 6f78608c94..da96d5704f 100644
--- a/browser/components/urlbar/tests/unit/head.js
+++ b/browser/components/urlbar/tests/unit/head.js
@@ -1110,44 +1110,13 @@ async function getOriginFrecency(prefix, aHost) {
}
/**
- * Returns the origin frecency stats.
- *
- * @returns {object}
- * An object { count, sum, squares }.
- */
-async function getOriginFrecencyStats() {
- let db = await PlacesUtils.promiseDBConnection();
- let rows = await db.execute(`
- SELECT
- IFNULL((SELECT value FROM moz_meta WHERE key = 'origin_frecency_count'), 0),
- IFNULL((SELECT value FROM moz_meta WHERE key = 'origin_frecency_sum'), 0),
- IFNULL((SELECT value FROM moz_meta WHERE key = 'origin_frecency_sum_of_squares'), 0)
- `);
- let count = rows[0].getResultByIndex(0);
- let sum = rows[0].getResultByIndex(1);
- let squares = rows[0].getResultByIndex(2);
- return { count, sum, squares };
-}
-
-/**
* Returns the origin autofill frecency threshold.
*
* @returns {number}
* The threshold.
*/
async function getOriginAutofillThreshold() {
- let { count, sum, squares } = await getOriginFrecencyStats();
- if (!count) {
- return 0;
- }
- if (count == 1) {
- return sum;
- }
- let stddevMultiplier = UrlbarPrefs.get("autoFill.stddevMultiplier");
- return (
- sum / count +
- stddevMultiplier * Math.sqrt((squares - (sum * sum) / count) / count)
- );
+ return PlacesUtils.metadata.get("origin_frecency_threshold", 2.0);
}
/**