diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /toolkit/components/places/tests/bookmarks | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/places/tests/bookmarks')
4 files changed, 29 insertions, 3 deletions
diff --git a/toolkit/components/places/tests/bookmarks/test_818584-discard-duplicate-backups.js b/toolkit/components/places/tests/bookmarks/test_818584-discard-duplicate-backups.js index be5d53f8c6..71065425fd 100644 --- a/toolkit/components/places/tests/bookmarks/test_818584-discard-duplicate-backups.js +++ b/toolkit/components/places/tests/bookmarks/test_818584-discard-duplicate-backups.js @@ -17,7 +17,7 @@ add_task(async function () { oldBackup ); Assert.ok(count > 0); - Assert.equal(hash.length, 24); + Assert.equal(hash.length, 44); oldBackupName = oldBackupName.replace( /\.json/, "_" + count + "_" + hash + ".json" diff --git a/toolkit/components/places/tests/bookmarks/test_818593-store-backup-metadata.js b/toolkit/components/places/tests/bookmarks/test_818593-store-backup-metadata.js index 6d280e8cad..265cc5621d 100644 --- a/toolkit/components/places/tests/bookmarks/test_818593-store-backup-metadata.js +++ b/toolkit/components/places/tests/bookmarks/test_818593-store-backup-metadata.js @@ -28,7 +28,7 @@ add_task(async function test_saveBookmarksToJSONFile_and_create() { PlacesBackups.filenamesRegex ); Assert.equal(matches[2], nodeCount); - Assert.equal(matches[3].length, 24); + Assert.equal(matches[3].length, 44); // Clear all backups in our backups folder. await PlacesBackups.create(0); @@ -44,7 +44,7 @@ add_task(async function test_saveBookmarksToJSONFile_and_create() { PlacesBackups.filenamesRegex ); Assert.equal(matches[2], nodeCount); - Assert.equal(matches[3].length, 24); + Assert.equal(matches[3].length, 44); // Cleanup await IOUtils.remove(backupFile); diff --git a/toolkit/components/places/tests/bookmarks/test_insert_thousands_bookmarks.js b/toolkit/components/places/tests/bookmarks/test_insert_thousands_bookmarks.js new file mode 100644 index 0000000000..9d1823449f --- /dev/null +++ b/toolkit/components/places/tests/bookmarks/test_insert_thousands_bookmarks.js @@ -0,0 +1,24 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +// Test `insertTree()` with more bookmarks than the Sqlite variables limit. + +add_task(async function () { + const NUM_BOOKMARKS = 1000; + await PlacesUtils.withConnectionWrapper("test", async db => { + db.variableLimit = NUM_BOOKMARKS - 100; + Assert.greater( + NUM_BOOKMARKS, + db.variableLimit, + "Insert more bookmarks than the Sqlite variables limit." + ); + }); + let children = []; + for (let i = 0; i < NUM_BOOKMARKS; ++i) { + children.push({ url: "http://www.mozilla.org/" + i }); + } + await PlacesUtils.bookmarks.insertTree({ + guid: PlacesUtils.bookmarks.toolbarGuid, + children, + }); +}); diff --git a/toolkit/components/places/tests/bookmarks/xpcshell.toml b/toolkit/components/places/tests/bookmarks/xpcshell.toml index 0b989e5fbf..c2e6d7ff09 100644 --- a/toolkit/components/places/tests/bookmarks/xpcshell.toml +++ b/toolkit/components/places/tests/bookmarks/xpcshell.toml @@ -70,6 +70,8 @@ support-files = ["bookmarks_long_tag.json"] ["test_bookmarks_update.js"] +["test_insert_thousands_bookmarks.js"] + ["test_insertTree_fixupOrSkipInvalidEntries.js"] ["test_keywords.js"] |