blob: 71f4241b11213c85607aca49b2785784662f61d6 [file] [log] [blame]
# 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("//build_overrides/build.gni")
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("tracing_config") {
sources = [
"common/background_tracing_state_manager.cc",
"common/background_tracing_state_manager.h",
"common/pref_names.cc",
"common/pref_names.h",
"common/tracing_scenarios_config.cc",
"common/tracing_scenarios_config.h",
"common/tracing_switches.cc",
"common/tracing_switches.h",
"tracing_export.h",
]
defines = [ "TRACING_IMPLEMENTATION" ]
deps = [
"//base",
"//components/prefs",
"//third_party/perfetto:libperfetto",
"//third_party/snappy",
]
}
if (is_win) {
component("tracing_etw") {
sources = [
"common/active_processes_win.cc",
"common/active_processes_win.h",
"common/etw_consumer_win.cc",
"common/etw_consumer_win.h",
"common/etw_export_win.cc",
"common/etw_export_win.h",
"common/etw_system_data_source_win.cc",
"common/etw_system_data_source_win.h",
"common/inclusion_policy_win.cc",
"common/inclusion_policy_win.h",
"common/system_log_event_utils_win.cc",
"common/system_log_event_utils_win.h",
"tracing_export.h",
]
defines = [ "TRACING_IMPLEMENTATION" ]
deps = [
"//base",
"//third_party/perfetto:libperfetto",
]
}
}
component("tracing_metrics") {
sources = [
"common/background_tracing_metrics_provider.cc",
"common/background_tracing_metrics_provider.h",
"common/system_profile_metadata_recorder.cc",
"common/system_profile_metadata_recorder.h",
"tracing_export.h",
]
defines = [ "TRACING_IMPLEMENTATION" ]
deps = [
"//base",
"//components/metrics:content",
"//content/public/browser",
"//third_party/metrics_proto",
]
}
component("background_tracing_utils") {
sources = [
"common/background_tracing_utils.cc",
"common/background_tracing_utils.h",
]
defines = [ "IS_BACKGROUND_TRACING_UTILS_IMPL" ]
deps = [
":tracing_config",
"//base",
"//content/public/browser",
]
}
source_set("unit_tests") {
testonly = true
deps = [
"//base/test:test_support",
"//testing/gmock",
"//testing/gtest",
"//third_party/snappy",
]
sources = [
"common/background_tracing_state_manager_unittest.cc",
"common/background_tracing_utils_unittest.cc",
]
if (is_android) {
sources += [ "common/graphics_memory_dump_provider_android_unittest.cc" ]
deps += [ ":graphics_provider" ]
}
data_deps = [
"//third_party/perfetto/protos/perfetto/config/chrome:scenario_descriptor",
]
data = [ "$root_gen_dir/third_party/perfetto/protos/perfetto/config/chrome/scenario_config.descriptor" ]
if (is_win) {
sources += [
"common/active_processes_win_unittest.cc",
"common/etw_consumer_win_unittest.cc",
"common/system_log_event_utils_win_unittest.cc",
]
deps += [
":tracing_etw",
"//base/version_info:generate_version_info",
"//third_party/perfetto:libperfetto",
]
}
deps += [
":background_tracing_utils",
":tracing_config",
"//base/test:proto_test_support",
"//components/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/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" ]
}
}