summaryrefslogtreecommitdiff
path: root/chromium/components/test/BUILD.gn
blob: 737c1a07ade3e310f5ef4d4192cb29a911f2c15d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//printing/buildflags/buildflags.gni")
import("//services/catalog/public/tools/catalog.gni")
import("//services/service_manager/public/service_manifest.gni")

source_set("test_support") {
  testonly = true

  sources = [
    "components_test_suite.cc",
    "components_test_suite.h",
  ]

  deps = [
    "//components/content_settings/core/common",
    "//components/gcm_driver:gcm_driver",
    "//components/signin/core/browser",
    "//mojo/edk",
    "//net",
    "//testing/gtest",
    "//ui/base",
    "//ui/resources:ui_test_pak",
  ]

  public_deps = [
    "//base/test:test_support",
  ]

  if (!is_ios) {
    deps += [
      "//components/invalidation/impl",
      "//components/policy/core/browser",
      "//ui/gl:test_support",
    ]

    public_deps += [ "//content/test:test_support" ]
  }
}

# Defines a main() function that uses components_test_suite.h
source_set("run_all_unittests") {
  testonly = true

  sources = [
    "run_all_unittests.cc",
  ]

  deps = [
    ":test_support",
  ]

  if (enable_basic_printing || enable_print_preview) {
    defines = [ "HAS_SERVICE_IN_UNIT_TEST" ]
    deps += [
      ":components_unittests_catalog_source",
      "//services/catalog:lib",
    ]
  }
}

if (enable_basic_printing || enable_print_preview) {
  # There is only one service in catalog, which depends on printing feature.
  # When more services are added, the condition can be moved inside of catalog.
  catalog("components_unittests_catalog") {
    embedded_services = [
      "//components/printing/service:pdf_compositor_service_unittest_manifest",
    ]
  }

  catalog_cpp_source("components_unittests_catalog_source") {
    testonly = true
    catalog = ":components_unittests_catalog"
    generated_function_name = "components::CreateUnittestsCatalog"
  }
}