chromium/services/proxy_resolver/BUILD.gn

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

import("//v8/gni/v8.gni")

source_set("lib") {
  sources = [
    "host_resolver_mojo.cc",
    "host_resolver_mojo.h",
    "mojo_proxy_resolver_v8_tracing_bindings.h",
    "pac_js_library.h",
    "proxy_host_resolver.h",
    "proxy_host_resolver_cache.cc",
    "proxy_host_resolver_cache.h",
    "proxy_resolver_factory_impl.cc",
    "proxy_resolver_factory_impl.h",
    "proxy_resolver_impl.cc",
    "proxy_resolver_impl.h",
    "proxy_resolver_v8.cc",
    "proxy_resolver_v8.h",
    "proxy_resolver_v8_tracing.cc",
    "proxy_resolver_v8_tracing.h",
  ]

  configs += [
    "//build/config/compiler:wexit_time_destructors",
    "//v8:external_startup_data",
  ]

  deps = [
    "//base",
    "//gin",
    "//mojo/public/cpp/bindings",
    "//tools/v8_context_snapshot:buildflags",
    "//url",
    "//v8",
  ]

  public_deps = [
    "//net",
    "//net:constants",
    "//services/network/public/mojom:mojom_ip_address",
    "//services/proxy_resolver/public/mojom",
    "//services/service_manager/public/cpp",
  ]
}

source_set("tests") {
  testonly = true

  sources = [
    "host_resolver_mojo_unittest.cc",
    "mock_proxy_host_resolver.cc",
    "mock_proxy_host_resolver.h",
    "mojo_proxy_resolver_v8_tracing_bindings_unittest.cc",
    "proxy_host_resolver_cache_unittest.cc",
    "proxy_resolver_factory_impl_unittest.cc",
    "proxy_resolver_impl_unittest.cc",
    "proxy_resolver_v8_tracing_unittest.cc",
    "proxy_resolver_v8_unittest.cc",
    "public/cpp/proxy_resolver_mojom_traits_unittests.cc",
  ]

  deps = [
    ":lib",
    "//base",
    "//base/test:test_support",
    "//mojo/public/cpp/test_support:test_utils",
    "//net:test_support",
    "//services/service_manager/public/cpp/test:test_support",
    "//testing/gmock",
    "//testing/gtest",
  ]

  if (v8_use_external_startup_data) {
    deps += [ "//gin" ]
  }

  configs += [ "//v8:external_startup_data" ]

  if (is_ios) {
    deps += [ "test:test_bundle_data" ]
  } else {
    data = [ "test/data/" ]
  }
}