Commit d4c4b89c authored by Charlie Harrison's avatar Charlie Harrison Committed by Commit Bot

Add ruleset indexing action as data_dep to telemetry tests

This allows telemetry to have access to an indexed ruleset, without
having to specify one in the source tree (which would need to be
updated every time the format version changes).

Follow-ups will copy this into telemetry's user-data-dir.

Bug: 823982
Change-Id: Iba551b1cd6137d73bed8dfbb0bc69d00f32be7ab
Reviewed-on: https://chromium-review.googlesource.com/1052860Reviewed-by: default avatarJosh Karlin <jkarlin@chromium.org>
Reviewed-by: default avatarNed Nguyen <nednguyen@google.com>
Commit-Queue: Charlie Harrison <csharrison@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557855}
parent b6b687f8
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//build/config/chromecast_build.gni") import("//build/compiled_action.gni")
static_library("tools_lib") { static_library("tools_lib") {
sources = [ sources = [
...@@ -40,7 +40,8 @@ source_set("unit_tests") { ...@@ -40,7 +40,8 @@ source_set("unit_tests") {
"//url", "//url",
] ]
} }
if (!is_ios && !is_android && !is_chromecast && !is_fuchsia) {
if (!is_ios) {
executable("subresource_filter_tool") { executable("subresource_filter_tool") {
# Production code should not depend on this. # Production code should not depend on this.
testonly = true testonly = true
...@@ -67,13 +68,53 @@ if (!is_ios && !is_android && !is_chromecast && !is_fuchsia) { ...@@ -67,13 +68,53 @@ if (!is_ios && !is_android && !is_chromecast && !is_fuchsia) {
] ]
} }
executable("ruleset_converter") {
sources = [
"ruleset_converter/main.cc",
]
deps = [
"ruleset_converter:support",
"//base",
"//build/config:exe_and_shlib_deps",
"//third_party/protobuf:protobuf_lite",
]
}
group("subresource_filter_tools") { group("subresource_filter_tools") {
# Production code should not depend on this. # Production code should not depend on this.
testonly = true testonly = true
deps = [ deps = [
":ruleset_converter",
":subresource_filter_tool", ":subresource_filter_tool",
":subresource_indexing_tool", ":subresource_indexing_tool",
"ruleset_converter", ]
}
# This action compiles the indexing tool using the host's toolchain, and
# generates an indexed ruleset using the existing unindexed ruleset in the
# source tree.
compiled_action("index_ruleset") {
testonly = true
tool = ":subresource_indexing_tool"
outputs = [
"$target_gen_dir/GeneratedRulesetData",
]
inputs = [
# Make sure the inputs are system-absolute, as base::File cannot open files with ".." components.
rebase_path(
"//components/subresource_filter/core/common/perftests/data/UnindexedRules_7.54",
"",
"/"),
]
deps = [
":subresource_indexing_tool",
]
args = [
inputs[0],
rebase_path("$target_gen_dir/GeneratedRulesetData", root_build_dir),
] ]
} }
} }
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//build/config/chromecast_build.gni")
source_set("support") { source_set("support") {
sources = [ sources = [
"//third_party/protobuf:protobuf_lite", "//third_party/protobuf:protobuf_lite",
...@@ -42,17 +40,3 @@ source_set("unit_tests") { ...@@ -42,17 +40,3 @@ source_set("unit_tests") {
"//testing/gtest", "//testing/gtest",
] ]
} }
if (!is_ios && !is_android && !is_chromecast && !is_fuchsia) {
executable("ruleset_converter") {
sources = [
"main.cc",
]
deps = [
":support",
"//base",
"//build/config:exe_and_shlib_deps",
"//third_party/protobuf:protobuf_lite",
]
}
}
...@@ -28,9 +28,19 @@ group("perf") { ...@@ -28,9 +28,19 @@ group("perf") {
# For image_decoding.measurement # For image_decoding.measurement
"//chrome/test/data/image_decoding/", "//chrome/test/data/image_decoding/",
# For ad tagging ruleset
"$root_gen_dir/components/subresource_filter/tools/",
# For Pylib used by VR tests # For Pylib used by VR tests
"//build/android/pylib/", "//build/android/pylib/",
] ]
# Runs a script which generates the ad tagging ruleset.
if (!is_ios) {
data_deps = [
"//components/subresource_filter/tools:index_ruleset",
]
}
} }
if (is_android) { if (is_android) {
...@@ -69,7 +79,17 @@ group("perf_without_chrome") { ...@@ -69,7 +79,17 @@ group("perf_without_chrome") {
# For image_decoding.measurement # For image_decoding.measurement
"//chrome/test/data/image_decoding/", "//chrome/test/data/image_decoding/",
# For ad tagging ruleset
"$root_gen_dir/components/subresource_filter/tools/",
# For Pylib used by VR tests # For Pylib used by VR tests
"//build/android/pylib/", "//build/android/pylib/",
] ]
# Runs a script which generates the ad tagging ruleset.
if (!is_ios) {
data_deps = [
"//components/subresource_filter/tools:index_ruleset",
]
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment