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

group("scheduler") {
  deps = [ ":factory" ]

  public_deps = [ "//chrome/browser/notifications/scheduler/public" ]
}

# The embedder can depend on this target to get the internal library.
source_set("factory") {
  sources = [
    "schedule_service_factory_helper.cc",
    "schedule_service_factory_helper.h",
  ]

  # This target should not depend on anything in //chrome/* except the proto
  # library.
  deps = [
    "//base",
    "//chrome/browser/notifications/proto",
    "//chrome/browser/notifications/scheduler/internal:lib",
    "//chrome/browser/notifications/scheduler/public",
    "//components/keyed_service/core",
    "//components/leveldb_proto",
    "//components/prefs",
    "//skia",
  ]
}

if (is_android) {
  source_set("unit_tests_local") {
    testonly = true
    sources = [ "tips_agent_android_unittest.cc" ]
    deps = [
      "//base",
      "//chrome/browser/notifications/scheduler/public",
      "//chrome/browser/notifications/scheduler/test:test_support",
      "//chrome/browser/segmentation_platform",
      "//chrome/test:test_support",
      "//components/prefs:test_support",
      "//components/segmentation_platform/public",
      "//components/segmentation_platform/public:test_support",
      "//components/signin/public/identity_manager:test_support",
      "//testing/gmock",
      "//testing/gtest",
    ]
  }
}

group("unit_tests") {
  testonly = true
  deps = [
    "//chrome/browser/notifications/scheduler/internal:unit_tests",
    "//chrome/browser/notifications/scheduler/public:unit_tests",
  ]
  if (is_android) {
    deps += [ ":unit_tests_local" ]
  }
}

if (!is_android) {
  source_set("browser_tests") {
    testonly = true

    defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]

    sources = [ "notification_schedule_service_browsertest.cc" ]

    deps = [
      ":factory",
      "//base",
      "//chrome/browser/notifications",
      "//chrome/browser/notifications/scheduler/public",
      "//chrome/browser/notifications/scheduler/test:test_support",
      "//chrome/browser/profiles:profile",
      "//chrome/browser/ui",
      "//chrome/test:test_support",
      "//chrome/test:test_support_ui",
      "//content/test:test_support",
      "//testing/gtest",
    ]
  }
}
