Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(727)

Unified Diff: components/variations/variations_seed_processor_unittest.cc

Issue 2612243003: Supporting study definitions without default groups and end_date filtering. (Closed)
Patch Set: removing static initializer Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/variations/variations_seed_processor.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/variations/variations_seed_processor_unittest.cc
diff --git a/components/variations/variations_seed_processor_unittest.cc b/components/variations/variations_seed_processor_unittest.cc
index 7703eed3b1ae1631c2f014239fc2d77dd575b1d3..01b36af19c32355b97ba758a9ce8409422384946 100644
--- a/components/variations/variations_seed_processor_unittest.cc
+++ b/components/variations/variations_seed_processor_unittest.cc
@@ -378,8 +378,9 @@ TEST_F(VariationsSeedProcessorTest, ValidateStudy) {
study.mutable_filter()->set_max_version("2.3.4");
EXPECT_TRUE(processed_study.Init(&study, false));
+ // A blank default study is allowed.
study.clear_default_experiment_name();
- EXPECT_FALSE(processed_study.Init(&study, false));
+ EXPECT_TRUE(processed_study.Init(&study, false));
study.set_default_experiment_name("xyz");
EXPECT_FALSE(processed_study.Init(&study, false));
@@ -839,12 +840,29 @@ TEST_F(VariationsSeedProcessorTest, FeaturesInExpiredStudies) {
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitWithFeatureList(std::move(feature_list));
- // Tthe feature should not be enabled, because the study is expired.
+ // The feature should not be enabled, because the study is expired.
EXPECT_EQ(test_case.expected_feature_enabled,
base::FeatureList::IsEnabled(test_case.feature));
}
}
+TEST_F(VariationsSeedProcessorTest, NoDefaultExperiment) {
+ base::FieldTrialList field_trial_list(nullptr);
+
+ Study study;
+ study.set_name("Study1");
+
+ AddExperiment("A", 1, &study);
+
+ EXPECT_TRUE(CreateTrialFromStudy(study));
+
+ base::FieldTrial* trial = base::FieldTrialList::Find("Study1");
+ trial->Disable();
+
+ EXPECT_EQ(ProcessedStudy::kGenericDefaultExperimentName,
+ base::FieldTrialList::FindFullName("Study1"));
+}
+
TEST_F(VariationsSeedProcessorTest, LowEntropyStudyTest) {
const std::string kTrial1Name = "A";
const std::string kTrial2Name = "B";
« no previous file with comments | « components/variations/variations_seed_processor.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698