Index: components/variations/variations_seed_processor.h |
diff --git a/components/variations/variations_seed_processor.h b/components/variations/variations_seed_processor.h |
index d714943b7008e89386339bc3045e8d3e96ea421d..d43c4593d5f499dd7f7257bce8d1f10ddfbabb3f 100644 |
--- a/components/variations/variations_seed_processor.h |
+++ b/components/variations/variations_seed_processor.h |
@@ -36,6 +36,10 @@ class VariationsSeedProcessor { |
Study_FormFactor form_factor); |
private: |
+ FRIEND_TEST_ALL_PREFIXES(VariationsSeedProcessorTest, |
+ AllowForceGroupAndVariationIdWithoutCommandLine); |
+ FRIEND_TEST_ALL_PREFIXES(VariationsSeedProcessorTest, |
+ AllowForceGroupAndVariationIdWithCommandLine); |
FRIEND_TEST_ALL_PREFIXES(VariationsSeedProcessorTest, CheckStudyChannel); |
FRIEND_TEST_ALL_PREFIXES(VariationsSeedProcessorTest, CheckStudyFormFactor); |
FRIEND_TEST_ALL_PREFIXES(VariationsSeedProcessorTest, CheckStudyLocale); |
@@ -44,6 +48,10 @@ class VariationsSeedProcessor { |
FRIEND_TEST_ALL_PREFIXES(VariationsSeedProcessorTest, CheckStudyVersion); |
FRIEND_TEST_ALL_PREFIXES(VariationsSeedProcessorTest, |
FilterAndValidateStudies); |
+ FRIEND_TEST_ALL_PREFIXES(VariationsSeedProcessorTest, |
+ ForbidForceGroupWithVariationIdWithoutCommandLine); |
+ FRIEND_TEST_ALL_PREFIXES(VariationsSeedProcessorTest, |
+ ForbidForceGroupWithVariationIdWithCommandLine); |
FRIEND_TEST_ALL_PREFIXES(VariationsSeedProcessorTest, ForceGroupWithFlag1); |
FRIEND_TEST_ALL_PREFIXES(VariationsSeedProcessorTest, ForceGroupWithFlag2); |
FRIEND_TEST_ALL_PREFIXES(VariationsSeedProcessorTest, |
@@ -51,11 +59,18 @@ class VariationsSeedProcessor { |
FRIEND_TEST_ALL_PREFIXES(VariationsSeedProcessorTest, |
ForceGroup_DontChooseGroupWithFlag); |
FRIEND_TEST_ALL_PREFIXES(VariationsSeedProcessorTest, IsStudyExpired); |
+ FRIEND_TEST_ALL_PREFIXES(VariationsSeedProcessorTest, |
+ TestAllowVariationIdWithForcingFlag); |
FRIEND_TEST_ALL_PREFIXES(VariationsSeedProcessorTest, ValidateStudy); |
FRIEND_TEST_ALL_PREFIXES(VariationsSeedProcessorTest, VariationParams); |
FRIEND_TEST_ALL_PREFIXES(VariationsSeedProcessorTest, |
VariationParamsWithForcingFlag); |
+ // Check if the |study| is only associated with platform Android/iOS and |
+ // channel dev/canary. If so, forcing flag and variation id can both be set. |
+ // (Otherwise, forcing_flag and variation_id are mutually exclusive.) |
+ bool AllowVariationIdWithForcingFlag(const Study& study); |
+ |
// Filters the list of studies in |seed| and validates and pre-processes them, |
// adding any kept studies to |filtered_studies| list. Ensures that the |
// resulting list will not have more than one study with the same name. |
@@ -95,6 +110,11 @@ class VariationsSeedProcessor { |
bool CheckStudyVersion(const Study_Filter& filter, |
const base::Version& version); |
+ // Check if there is variation id associated with |experiment|. If so, |
+ // register the variation id. |
+ void CheckVariationId(const Study_Experiment& experiment, |
+ const std::string& trial_name); |
+ |
// Creates and registers a field trial from the |processed_study| data. |
// Disables the trial if |processed_study.is_expired| is true. |
void CreateTrialFromStudy(const ProcessedStudy& processed_study); |