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

Unified Diff: components/variations/study_filtering_unittest.cc

Issue 2615763002: Revert of Supporting study definitions without default groups and end_date filtering. (Closed)
Patch Set: 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/study_filtering.cc ('k') | components/variations/variations_seed_processor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/variations/study_filtering_unittest.cc
diff --git a/components/variations/study_filtering_unittest.cc b/components/variations/study_filtering_unittest.cc
index 98490f016ce7034c39a4129101ab8dda07547bfa..d8008cf26952d54416de820eae5180c6c402f594 100644
--- a/components/variations/study_filtering_unittest.cc
+++ b/components/variations/study_filtering_unittest.cc
@@ -227,11 +227,9 @@
const base::Time start_date;
bool expected_result;
} start_test_cases[] = {
- {now - delta, true},
- // Note, the proto start_date is truncated to seconds, but the reference
- // date isn't.
- {now, true},
- {now + delta, false},
+ { now - delta, true },
+ { now, true },
+ { now + delta, false },
};
Study_Filter filter;
@@ -244,29 +242,6 @@
const bool result = internal::CheckStudyStartDate(filter, now);
EXPECT_EQ(start_test_cases[i].expected_result, result)
<< "Case " << i << " failed!";
- }
-}
-
-TEST(VariationsStudyFilteringTest, CheckStudyEndDate) {
- const base::Time now = base::Time::Now();
- const base::TimeDelta delta = base::TimeDelta::FromHours(1);
- const struct {
- const base::Time end_date;
- bool expected_result;
- } start_test_cases[] = {
- {now - delta, false}, {now + delta, true},
- };
-
- Study_Filter filter;
-
- // End date not set should result in true.
- EXPECT_TRUE(internal::CheckStudyEndDate(filter, now));
-
- for (size_t i = 0; i < arraysize(start_test_cases); ++i) {
- filter.set_end_date(TimeToProtoTime(start_test_cases[i].end_date));
- const bool result = internal::CheckStudyEndDate(filter, now);
- EXPECT_EQ(start_test_cases[i].expected_result, result) << "Case " << i
- << " failed!";
}
}
@@ -598,9 +573,8 @@
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_TRUE(processed_study.Init(&study, false));
+ EXPECT_FALSE(processed_study.Init(&study, false));
study.set_default_experiment_name("xyz");
EXPECT_FALSE(processed_study.Init(&study, false));
« no previous file with comments | « components/variations/study_filtering.cc ('k') | components/variations/variations_seed_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698