Move helper function into variations_test_utils.
This helper function will be reused in iOS integration tests. See
crrev/c/3020141.
Also, describe the contents of the test variations seed data and put
VariationsSafeModeBrowserTest within the variations namespace.
Bug: 1220163, 1205645
Change-Id: I99950b591861be9796448a7db50493931dfab2a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3020062
Reviewed-by: Steven Holte <[email protected]>
Commit-Queue: Caitlin Fischer <[email protected]>
Cr-Commit-Position: refs/heads/master@{#900813}
diff --git a/components/variations/variations_test_utils.cc b/components/variations/variations_test_utils.cc
index af1620c..577f2ef 100644
--- a/components/variations/variations_test_utils.cc
+++ b/components/variations/variations_test_utils.cc
@@ -10,6 +10,7 @@
#include "components/variations/proto/client_variations.pb.h"
#include "components/variations/variations_associated_data.h"
#include "components/variations/variations_switches.h"
+#include "third_party/zlib/google/compression_utils.h"
namespace variations {
@@ -24,6 +25,20 @@
"MEQCIDD1IVxjzWYncun+9IGzqYjZvqxxujQEayJULTlbTGA/AiAr0oVmEgVUQZBYq5VLOSvy"
"96JkMYgzTkHPwbv7K/CmgA==";
+const char kTestSeedStudyName[] = "UMA-Uniformity-Trial-10-Percent";
+
+std::string GetTestSeedForPrefs() {
+ std::string serialized_seed;
+ base::Base64Decode(kUncompressedBase64TestSeedData, &serialized_seed);
+
+ std::string compressed_seed_data;
+ compression::GzipCompress(serialized_seed, &compressed_seed_data);
+
+ std::string base64_seed_data;
+ base::Base64Encode(compressed_seed_data, &base64_seed_data);
+ return base64_seed_data;
+}
+
void DisableTestingConfig() {
base::CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kDisableFieldTrialTestingConfig);