diff --git a/Package.swift b/Package.swift index 89eddfd63..fa8c4e038 100644 --- a/Package.swift +++ b/Package.swift @@ -251,7 +251,10 @@ let package = Package( .copy("Resources/Bookmarks_V2.sqlite-wal"), .copy("Resources/Bookmarks_V3.sqlite"), .copy("Resources/Bookmarks_V3.sqlite-shm"), - .copy("Resources/Bookmarks_V3.sqlite-wal") + .copy("Resources/Bookmarks_V3.sqlite-wal"), + .copy("Resources/Bookmarks_V4.sqlite"), + .copy("Resources/Bookmarks_V4.sqlite-shm"), + .copy("Resources/Bookmarks_V4.sqlite-wal") ]), .testTarget( name: "BrowserServicesKitTests", diff --git a/Tests/BookmarksTests/BookmarkMigrationTests.swift b/Tests/BookmarksTests/BookmarkMigrationTests.swift index 3f13e1d94..baae0fb03 100644 --- a/Tests/BookmarksTests/BookmarkMigrationTests.swift +++ b/Tests/BookmarksTests/BookmarkMigrationTests.swift @@ -88,6 +88,10 @@ class BookmarkMigrationTests: XCTestCase { try commonMigrationTestForDatabase(name: "Bookmarks_V3") } + func testWhenMigratingFromV4ThenRootFoldersContentsArePreservedInOrder() throws { + try commonMigrationTestForDatabase(name: "Bookmarks_V4") + } + func commonMigrationTestForDatabase(name: String) throws { try copyDatabase(name: name, formDirectory: resourceURLDir, toDirectory: location) @@ -131,7 +135,7 @@ class BookmarkMigrationTests: XCTestCase { try? migratedStack.tearDown(deleteStores: true) } - func atestThatMigrationToFormFactorSpecificFavoritesAddsFavoritesToNativeFolder() async throws { + func testThatMigrationToFormFactorSpecificFavoritesAddsFavoritesToNativeFolder() async throws { guard let bookmarksDatabase = loadDatabase(name: "Any") else { XCTFail("Failed to load model") diff --git a/Tests/BookmarksTests/Resources/Bookmarks_V4.sqlite b/Tests/BookmarksTests/Resources/Bookmarks_V4.sqlite new file mode 100644 index 000000000..248921609 Binary files /dev/null and b/Tests/BookmarksTests/Resources/Bookmarks_V4.sqlite differ diff --git a/Tests/BookmarksTests/Resources/Bookmarks_V4.sqlite-shm b/Tests/BookmarksTests/Resources/Bookmarks_V4.sqlite-shm new file mode 100644 index 000000000..0738e5302 Binary files /dev/null and b/Tests/BookmarksTests/Resources/Bookmarks_V4.sqlite-shm differ diff --git a/Tests/BookmarksTests/Resources/Bookmarks_V4.sqlite-wal b/Tests/BookmarksTests/Resources/Bookmarks_V4.sqlite-wal new file mode 100644 index 000000000..bc900786c Binary files /dev/null and b/Tests/BookmarksTests/Resources/Bookmarks_V4.sqlite-wal differ