chromium/components/leveldb_proto/BUILD.gn

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

import("//third_party/protobuf/proto_library.gni")

proto_library("proto") {
  sources = [ "internal/proto/shared_db_metadata.proto" ]
}

component("leveldb_proto") {
  sources = [
    "internal/leveldb_database.cc",
    "internal/leveldb_database.h",
    "internal/leveldb_proto_feature_list.cc",
    "internal/leveldb_proto_feature_list.h",
    "internal/migration_delegate.cc",
    "internal/migration_delegate.h",
    "internal/proto_database_impl.cc",
    "internal/proto_database_impl.h",
    "internal/proto_database_selector.cc",
    "internal/proto_database_selector.h",
    "internal/proto_leveldb_wrapper.cc",
    "internal/proto_leveldb_wrapper.h",
    "internal/proto_leveldb_wrapper_metrics.cc",
    "internal/proto_leveldb_wrapper_metrics.h",
    "internal/shared_proto_database.cc",
    "internal/shared_proto_database.h",
    "internal/shared_proto_database_client.cc",
    "internal/shared_proto_database_client.h",
    "internal/shared_proto_database_provider.cc",
    "internal/shared_proto_database_provider.h",
    "internal/unique_proto_database.cc",
    "internal/unique_proto_database.h",
    "public/proto_database.cc",
    "public/proto_database.h",
    "public/proto_database_provider.cc",
    "public/proto_database_provider.h",
    "public/shared_proto_database_client_list.cc",
    "public/shared_proto_database_client_list.h",
  ]
  defines = [ "IS_LEVELDB_PROTO_IMPL" ]
  deps = [ ":proto" ]

  public_deps = [
    "//base",
    "//components/keyed_service/core",
    "//third_party/leveldatabase",
  ]
}

source_set("test_support") {
  testonly = true
  sources = [ "testing/fake_db.h" ]

  public_deps = [
    ":leveldb_proto",
    "//base",
    "//base/test:test_support",
    "//components/leveldb_proto/testing/proto",
  ]
}

source_set("unit_tests") {
  testonly = true
  sources = [
    "internal/proto_database_impl_unittest.cc",
    "internal/shared_proto_database_client_list_unittest.cc",
    "internal/shared_proto_database_client_unittest.cc",
    "internal/shared_proto_database_unittest.cc",
    "internal/unique_proto_database_unittest.cc",
  ]
  deps = [
    ":proto",
    ":test_support",
    "//testing/gmock",
    "//testing/gtest",
  ]
}