Index: components/variations/BUILD.gn |
diff --git a/components/variations/BUILD.gn b/components/variations/BUILD.gn |
index f4e62354bf980b05a6d1eb58a97812d5437af0cf..ffc56daa1034755a62a2297d86aed587413778a6 100644 |
--- a/components/variations/BUILD.gn |
+++ b/components/variations/BUILD.gn |
@@ -6,6 +6,34 @@ if (is_android) { |
import("//build/config/android/rules.gni") |
} |
+action("fieldtrial_testing_config_action") { |
+ visibility = [ ":variations" ] |
+ script = "//tools/variations/fieldtrial_to_struct.py" |
+ |
+ source = "//testing/variations/fieldtrial_testing_config.json" |
+ inputs = [ |
+ "//tools/json_to_struct/element_generator.py", |
+ "//tools/json_to_struct/json_to_struct.py", |
+ "//tools/json_to_struct/struct_generator.py", |
+ source, |
+ ] |
+ out_name = "fieldtrial_testing_config" |
+ outputs = [ |
+ "$target_gen_dir/$out_name.cc", |
+ "$target_gen_dir/$out_name.h", |
+ ] |
+ |
+ args = [ |
+ rebase_path(source, root_build_dir), |
+ "--destbase=" + rebase_path(target_gen_dir, root_build_dir), |
+ "--namespace=variations", |
+ "--schema=" + |
+ rebase_path("fieldtrial_testing_config_schema.json", root_build_dir), |
+ "--platform=" + current_os, |
+ "--output=$out_name", |
+ ] |
+} |
+ |
static_library("variations") { |
sources = [ |
"active_field_trials.cc", |
@@ -22,6 +50,8 @@ static_library("variations") { |
"entropy_provider.h", |
"experiment_labels.cc", |
"experiment_labels.h", |
+ "fieldtrial_util.cc", |
+ "fieldtrial_util.h", |
"metrics_util.cc", |
"metrics_util.h", |
"pref_names.cc", |
@@ -58,6 +88,8 @@ static_library("variations") { |
"variations_util.h", |
] |
+ sources += get_target_outputs(":fieldtrial_testing_config_action") |
+ |
if (is_android || is_ios) { |
sources += [ |
"variations_request_scheduler_mobile.cc", |
@@ -66,11 +98,13 @@ static_library("variations") { |
} |
deps = [ |
+ ":fieldtrial_testing_config_action", |
"proto", |
"//base", |
"//components/crash/core/common", |
"//components/prefs", |
"//crypto", |
+ "//net", |
"//third_party/mt19937ar", |
"//third_party/protobuf:protobuf_lite", |
"//third_party/zlib:compression_utils", |
@@ -98,6 +132,7 @@ source_set("unit_tests") { |
"caching_permuted_entropy_provider_unittest.cc", |
"entropy_provider_unittest.cc", |
"experiment_labels_unittest.cc", |
+ "fieldtrial_util_unittest.cc", |
"metrics_util_unittest.cc", |
"net/variations_http_headers_unittest.cc", |
"study_filtering_unittest.cc", |