Skip to content

Commit

Permalink
Update to unit test to support migrated vault.db file
Browse files Browse the repository at this point in the history
  • Loading branch information
amddg44 committed Dec 3, 2024
1 parent 3b030bd commit ae0d97c
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ class DatabaseProviderTests: XCTestCase {
try FileManager.default.removeItem(atPath: dbFileContainer.appendingPathComponent(file).path)
}

#if os(iOS)
let sharedDbFileContainer = DefaultAutofillDatabaseProvider.defaultSharedDatabaseURL().deletingLastPathComponent()
for file in try FileManager.default.contentsOfDirectory(atPath: sharedDbFileContainer.path) {
guard ["db", "bak"].contains((file as NSString).pathExtension) else { continue }
try FileManager.default.removeItem(atPath: sharedDbFileContainer.appendingPathComponent(file).path)
}
#endif
} catch let error as NSError {
// File not found
if error.domain != NSCocoaErrorDomain || error.code != 4 {
Expand Down

0 comments on commit ae0d97c

Please sign in to comment.