summaryrefslogtreecommitdiffstats
path: root/toolkit/components/places/tests/bookmarks/test_insert_thousands_bookmarks.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 /toolkit/components/places/tests/bookmarks/test_insert_thousands_bookmarks.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 'toolkit/components/places/tests/bookmarks/test_insert_thousands_bookmarks.js')
-rw-r--r--toolkit/components/places/tests/bookmarks/test_insert_thousands_bookmarks.js24
1 files changed, 24 insertions, 0 deletions
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,
+ });
+});