chromium/components/rlz/BUILD.gn

# Copyright 2015 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/chromeos/ui_mode.gni")

static_library("rlz") {
  sources = [
    "rlz_tracker.cc",
    "rlz_tracker.h",
    "rlz_tracker_delegate.h",
  ]

  if (is_ios) {
    sources += [ "rlz_tracker_ios.cc" ]
  }

  if (is_mac) {
    sources += [ "rlz_tracker_mac.cc" ]
  }

  if (is_win) {
    sources += [ "rlz_tracker_win.cc" ]
  }

  if (is_chromeos_ash) {
    sources += [ "rlz_tracker_chromeos.cc" ]
  }

  deps = [
    "//base",
    "//build:chromeos_buildflags",
    "//components/google/core/common",
    "//net",
    "//rlz:rlz_lib",
    "//services/network/public/cpp:cpp",
  ]

  if (is_ios) {
    deps += [ "//ui/base" ]
  }
}

source_set("test_support") {
  testonly = true
  sources = [
    "mock_rlz_tracker_delegate.cc",
    "mock_rlz_tracker_delegate.h",
  ]
  public_deps = [ "//testing/gmock" ]
  deps = [
    ":rlz",
    "//services/network/public/cpp:cpp",
  ]
}

source_set("unit_tests") {
  testonly = true
  sources = [ "rlz_tracker_unittest.cc" ]

  deps = [
    ":rlz",
    "//build:chromeos_buildflags",
    "//net:test_support",
    "//rlz:test_support",
    "//services/network/public/cpp:cpp",
    "//ui/base",
  ]

  if (is_chromeos_ash) {
    deps += [ "//chromeos/ash/components/system" ]
  }
}