From 40a355a42d4a9444dc753c04c6608dade2f06a23 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:27 +0200 Subject: Adding upstream version 125.0.1. Signed-off-by: Daniel Baumann --- .../places/tests/migration/places_v75.sqlite | Bin 1507328 -> 0 bytes .../places/tests/migration/places_v77.sqlite | Bin 0 -> 1507328 bytes .../tests/migration/test_current_from_v74.js | 26 ++++++++++++++++++++- .../places/tests/migration/xpcshell.toml | 2 +- 4 files changed, 26 insertions(+), 2 deletions(-) delete mode 100644 toolkit/components/places/tests/migration/places_v75.sqlite create mode 100644 toolkit/components/places/tests/migration/places_v77.sqlite (limited to 'toolkit/components/places/tests/migration') diff --git a/toolkit/components/places/tests/migration/places_v75.sqlite b/toolkit/components/places/tests/migration/places_v75.sqlite deleted file mode 100644 index 2dd624b945..0000000000 Binary files a/toolkit/components/places/tests/migration/places_v75.sqlite and /dev/null differ diff --git a/toolkit/components/places/tests/migration/places_v77.sqlite b/toolkit/components/places/tests/migration/places_v77.sqlite new file mode 100644 index 0000000000..d77d8233b0 Binary files /dev/null and b/toolkit/components/places/tests/migration/places_v77.sqlite differ diff --git a/toolkit/components/places/tests/migration/test_current_from_v74.js b/toolkit/components/places/tests/migration/test_current_from_v74.js index 82c535f78f..eeb862daf5 100644 --- a/toolkit/components/places/tests/migration/test_current_from_v74.js +++ b/toolkit/components/places/tests/migration/test_current_from_v74.js @@ -4,7 +4,16 @@ "use strict"; add_task(async function setup() { - await setupPlacesDatabase("places_v74.sqlite"); + let path = await setupPlacesDatabase("places_v74.sqlite"); + let db = await Sqlite.openConnection({ path }); + await db.execute(` + INSERT INTO moz_origins (id, prefix, host, frecency, recalc_frecency) + VALUES + (100, 'https://', 'test1.com', 0, 0), + (101, 'https://', 'test2.com', 0, 0), + (102, 'https://', 'test3.com', 0, 0) + `); + await db.close(); }); add_task(async function database_is_valid() { @@ -20,3 +29,18 @@ add_task(async function database_is_valid() { await db.execute("SELECT * FROM moz_places_extra"); await db.execute("SELECT * from moz_historyvisits_extra"); }); + +add_task(async function recalc_origins_frecency() { + const db = await PlacesUtils.promiseDBConnection(); + Assert.equal(await db.getSchemaVersion(), CURRENT_SCHEMA_VERSION); + + Assert.equal( + ( + await db.execute( + "SELECT count(*) FROM moz_origins WHERE recalc_frecency = 0" + ) + )[0].getResultByIndex(0), + 0, + "All entries should be set for recalculation" + ); +}); diff --git a/toolkit/components/places/tests/migration/xpcshell.toml b/toolkit/components/places/tests/migration/xpcshell.toml index b127fa501f..06dbb67fce 100644 --- a/toolkit/components/places/tests/migration/xpcshell.toml +++ b/toolkit/components/places/tests/migration/xpcshell.toml @@ -14,7 +14,7 @@ support-files = [ "places_v70.sqlite", "places_v72.sqlite", "places_v74.sqlite", - "places_v75.sqlite", + "places_v77.sqlite", ] ["test_current_from_downgraded.js"] -- cgit v1.2.3