summaryrefslogtreecommitdiff
path: root/chromium/components/tracing/BUILD.gn
blob: e8f415ab484096cf637b587efc487559568d022b (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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# 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("//testing/test.gni")

if (is_android) {
  component("graphics_provider") {
    sources = [
      "common/graphics_memory_dump_provider_android.cc",
      "common/graphics_memory_dump_provider_android.h",
      "tracing_export.h",
    ]

    defines = [ "TRACING_IMPLEMENTATION" ]

    deps = [ "//base" ]
  }
}

component("startup_tracing") {
  sources = [
    "common/trace_startup_config.cc",
    "common/trace_startup_config.h",
    "common/trace_to_console.cc",
    "common/trace_to_console.h",
    "common/tracing_switches.cc",
    "common/tracing_switches.h",
    "tracing_export.h",
  ]

  defines = [ "TRACING_IMPLEMENTATION" ]

  deps = [ "//base" ]
}

component("background_tracing_metrics_provider") {
  sources = [
    "common/background_tracing_metrics_provider.cc",
    "common/background_tracing_metrics_provider.h",
    "tracing_export.h",
  ]

  defines = [ "TRACING_IMPLEMENTATION" ]

  deps = [
    "//base",
    "//components/metrics:content",
    "//content/public/browser",
  ]
}

component("background_tracing_utils") {
  sources = [
    "common/background_tracing_state_manager.cc",
    "common/background_tracing_state_manager.h",
    "common/background_tracing_utils.cc",
    "common/background_tracing_utils.h",
    "common/pref_names.cc",
    "common/pref_names.h",
  ]

  defines = [ "IS_BACKGROUND_TRACING_UTILS_IMPL" ]

  deps = [
    ":startup_tracing",
    "//base",
    "//components/prefs",
    "//content/public/browser",
  ]
}

source_set("unit_tests") {
  testonly = true

  deps = [
    "//base/test:test_support",
    "//testing/gmock:gmock",
    "//testing/gtest",
  ]

  if (is_android) {
    sources = [ "common/graphics_memory_dump_provider_android_unittest.cc" ]
    deps += [ ":graphics_provider" ]
  }

  if (!is_android) {
    sources = [ "common/trace_startup_config_unittest.cc" ]
    deps += [ ":startup_tracing" ]
  }

  sources += [
    "common/background_tracing_state_manager_unittest.cc",
    "common/background_tracing_utils_unittest.cc",
  ]
  deps += [
    ":background_tracing_utils",
    ":startup_tracing",
    "//components/metrics:metrics",
    "//components/prefs:test_support",
    "//content/public/browser",
    "//content/test:test_support",
  ]
}

test("tracing_perftests") {
  sources = [
    "test/perf_test_helpers.cc",
    "test/perf_test_helpers.h",
    "test/trace_event_perftest.cc",
  ]
  deps = [
    "//base:base",
    "//base/test:test_support",
    "//base/test:test_support_perf",
    "//testing/gtest",
    "//testing/perf",
  ]

  data_deps = [
    # Needed for isolate script to execute.
    "//testing:run_perf_test",
  ]

  if (is_android) {
    deps += [ "//testing/android/native_test:native_test_native_code" ]
  }
}