blob: eda3fb23ff6271702f69c142db252f4b37fe1887 [file] [log] [blame]
# 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("//testing/test.gni")
import("//third_party/protobuf/proto_library.gni")
# Works only on Windows and Linux.
assert(is_win || is_linux || is_chromeos)
proto_library("chrome_settings_full_runtime") {
proto_out_dir = "/tools/traffic_annotation"
cc_include = "components/policy/proto/policy_proto_export.h"
sources = [
"$root_gen_dir" +
"/components/policy/proto/cloud_policy_full_runtime.proto",
"$root_gen_dir" +
"/components/policy/proto/chrome_settings_full_runtime.proto",
"$root_gen_dir" +
"/components/policy/proto/policy_common_definitions_full_runtime.proto",
]
use_protobuf_full = true
deps = [
"//components/policy:full_runtime_code_generate",
"//third_party/protobuf:protobuf_full",
]
}
proto_library("traffic_annotation") {
sources = [ "//chrome/browser/privacy/traffic_annotation.proto" ]
proto_out_dir = "tools/traffic_annotation"
import_dirs = [ "$root_gen_dir" + "/components/policy/proto" ]
deps = [ ":chrome_settings_full_runtime" ]
use_protobuf_full = true
}
source_set("auditor_sources") {
sources = [
"../../../net/traffic_annotation/network_traffic_annotation.h",
"../../../net/traffic_annotation/network_traffic_annotation_test_helper.h",
"auditor_result.cc",
"auditor_result.h",
"instance.cc",
"instance.h",
"traffic_annotation_auditor.cc",
"traffic_annotation_auditor.h",
"traffic_annotation_exporter.cc",
"traffic_annotation_exporter.h",
"traffic_annotation_file_filter.cc",
"traffic_annotation_file_filter.h",
"traffic_annotation_id_checker.cc",
"traffic_annotation_id_checker.h",
]
data = [
"//chrome/VERSION",
"safe_list.txt",
"traffic_annotation_extractor_switches.txt",
]
public_deps = [
":traffic_annotation",
"//base",
"//net/traffic_annotation",
"//third_party/libxml:xml_reader", # Safe, consumes Chromium-produced file.
"//third_party/libxml:xml_writer",
"//third_party/protobuf:protobuf_full",
"//third_party/re2",
]
deps = [ "//build:chromeos_buildflags" ]
}
executable("traffic_annotation_auditor") {
sources = [ "traffic_annotation_auditor_ui.cc" ]
deps = [ ":auditor_sources" ]
}
test("traffic_annotation_auditor_unittests") {
sources = [ "traffic_annotation_auditor_unittest.cc" ]
data = [
"//chrome/VERSION",
"../summary/annotations.xml",
"tests/annotations_diff12.txt",
"tests/annotations_diff13.txt",
"tests/annotations_diff23.txt",
"tests/annotations_sample1.xml",
"tests/annotations_sample2.xml",
"tests/annotations_sample3.xml",
"tests/extractor_outputs/bad_assignment.txt",
"tests/extractor_outputs/bad_call.txt",
"tests/extractor_outputs/bad_syntax_annotation1.txt",
"tests/extractor_outputs/bad_syntax_annotation2.txt",
"tests/extractor_outputs/bad_syntax_annotation3.txt",
"tests/extractor_outputs/bad_syntax_annotation4.txt",
"tests/extractor_outputs/fatal_annotation1.txt",
"tests/extractor_outputs/fatal_annotation2.txt",
"tests/extractor_outputs/fatal_annotation3.txt",
"tests/extractor_outputs/good_assignment.txt",
"tests/extractor_outputs/good_branched_completing_annotation.txt",
"tests/extractor_outputs/good_call.txt",
"tests/extractor_outputs/good_complete_annotation.txt",
"tests/extractor_outputs/good_completing_annotation.txt",
"tests/extractor_outputs/good_partial_annotation.txt",
"tests/extractor_outputs/good_test_annotation.txt",
"tests/extractor_outputs/missing_annotation.txt",
"tests/git_list.txt",
"tests/gn_list_negative.txt",
"tests/gn_list_positive.txt",
"tests/irrelevant_file_content.cc",
"tests/irrelevant_file_content.mm",
"tests/irrelevant_file_name.txt",
"tests/relevant_file_name_and_content.cc",
"tests/relevant_file_name_and_content.mm",
"tests/test_grouping.xml",
]
deps = [
":auditor_sources",
"//base/test:run_all_unittests",
"//base/test:test_support",
"//testing/gmock",
"//testing/gtest",
]
}