1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
# Copyright 2025 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/zip.gni")
import("//build/rust/rust_static_library.gni")
source_set("safari_data_importer") {
sources = [
"safari_data_import_manager.cc",
"safari_data_import_manager.h",
"safari_data_importer.cc",
"safari_data_importer.h",
]
deps = [
":zip_ffi_glue",
"//base",
"//components/password_manager/core/browser/import:importer",
"//components/password_manager/core/browser/ui",
"//components/user_data_importer/common",
]
}
rust_static_library("zip_ffi_glue") {
allow_unsafe = true
crate_root = "zip_ffi_glue.rs"
sources = [ "zip_ffi_glue.rs" ]
cxx_bindings = [ "zip_ffi_glue.rs" ]
visibility = [ ":safari_data_importer" ]
deps = [
"//third_party/rust/anyhow/v1:lib",
"//third_party/rust/serde/v1:lib",
"//third_party/rust/serde_json_lenient/v0_2:lib",
"//third_party/rust/zip/v4:lib",
]
}
copy("test_archive_files") {
sources = [
"Bookmarks.html",
"History.json",
"Passwords.csv",
"PaymentCards.json",
]
outputs = [ "$target_out_dir/{{source_file_part}}" ]
}
zip("test_archive") {
testonly = true
output = "$root_out_dir/test_archive.zip"
inputs = [
"$target_out_dir/Bookmarks.html",
"$target_out_dir/History.json",
"$target_out_dir/Passwords.csv",
"$target_out_dir/PaymentCards.json",
]
deps = [ ":test_archive_files" ]
}
if (is_ios) {
bundle_data("test_archive_bundle_data") {
testonly = true
public_deps = [ ":test_archive" ]
sources = [ "$root_out_dir/test_archive.zip" ]
outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
}
}
source_set("unit_tests") {
testonly = true
sources = [ "safari_data_importer_unittest.cc" ]
deps = [
":safari_data_importer",
"//base",
"//base/test:test_support",
"//components/affiliations/core/browser:test_support",
"//components/password_manager/core/browser/import:csv",
"//components/password_manager/core/browser/import:importer",
"//components/password_manager/core/browser/password_store:test_support",
"//components/password_manager/core/browser/ui",
"//components/password_manager/core/browser/ui:credential_ui_entry",
"//components/password_manager/core/common:constants",
"//mojo/public/cpp/bindings",
"//testing/gmock",
"//testing/gtest",
]
if (is_ios) {
deps += [
":test_archive_bundle_data",
"//components/password_manager/services/csv_password/ios:fake_password_parser_service",
]
} else {
data_deps = [ ":test_archive" ]
deps += [ "//components/password_manager/services/csv_password:fake_password_parser_service" ]
}
}
|