chromium/components/download/database/BUILD.gn

# Copyright 2018 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

if (is_android) {
  import("//build/config/android/config.gni")
  import("//build/config/android/rules.gni")
}

source_set("database") {
  sources = [
    "download_db.cc",
    "download_db.h",
    "download_db_conversions.cc",
    "download_db_conversions.h",
    "download_db_entry.cc",
    "download_db_entry.h",
    "download_db_impl.cc",
    "download_db_impl.h",
    "download_info.cc",
    "download_info.h",
    "download_namespace.cc",
    "download_namespace.h",
    "in_progress/download_entry.cc",
    "in_progress/download_entry.h",
    "in_progress/in_progress_info.cc",
    "in_progress/in_progress_info.h",
    "in_progress/ukm_info.cc",
    "in_progress/ukm_info.h",
  ]

  deps = [
    "//base",
    "//components/download/database/proto:download_entry_proto",
    "//components/download/database/proto:download_source_proto",
    "//components/leveldb_proto",
    "//net",
    "//services/metrics/public/cpp:metrics_cpp",
    "//services/network/public/mojom",
  ]

  configs += [ "//build/config/compiler:wexit_time_destructors" ]
}

source_set("unit_tests") {
  testonly = true

  sources = [
    "download_db_conversions_unittest.cc",
    "download_db_impl_unittest.cc",
  ]

  deps = [
    ":database",
    "//base/test:test_support",
    "//components/download/database/proto:download_entry_proto",
    "//components/download/database/proto:download_source_proto",
    "//components/download/public/common:public",
    "//components/leveldb_proto:test_support",
    "//services/network/public/mojom",
    "//testing/gmock",
    "//testing/gtest",
  ]
}