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

Unified Diff: components/variations/study_filtering_unittest.cc

Issue 2970093002: Add variations filtering for is_low_end_device. (Closed)
Patch Set: Created 3 years, 5 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
Index: components/variations/study_filtering_unittest.cc
diff --git a/components/variations/study_filtering_unittest.cc b/components/variations/study_filtering_unittest.cc
index 1d70c48c8cf04ef5f78ca8781f783a95dfb375c6..18f2593d7c8cb6cfd6112fd424f71dff10c28fe2 100644
--- a/components/variations/study_filtering_unittest.cc
+++ b/components/variations/study_filtering_unittest.cc
@@ -255,6 +255,22 @@ TEST(VariationsStudyFilteringTest, CheckStudyPlatform) {
}
}
+TEST(VariationsStudyFilteringTest, CheckStudyLowEndDevice) {
+ Study::Filter filter;
+
+ // Check that if the filter is not set, study applies to either low end.
rkaplow 2017/07/06 17:49:49 nit - "either low end setting"? Current wording se
Alexei Svitkine (slow) 2017/07/11 15:08:14 Done.
+ EXPECT_TRUE(internal::CheckStudyLowEndDevice(filter, true));
+ EXPECT_TRUE(internal::CheckStudyLowEndDevice(filter, false));
+
+ filter.set_is_low_end_device(true);
+ EXPECT_TRUE(internal::CheckStudyLowEndDevice(filter, true));
+ EXPECT_FALSE(internal::CheckStudyLowEndDevice(filter, false));
+
+ filter.set_is_low_end_device(false);
+ EXPECT_FALSE(internal::CheckStudyLowEndDevice(filter, true));
+ EXPECT_TRUE(internal::CheckStudyLowEndDevice(filter, false));
+}
+
TEST(VariationsStudyFilteringTest, CheckStudyStartDate) {
const base::Time now = base::Time::Now();
const base::TimeDelta delta = base::TimeDelta::FromHours(1);
« components/variations/client_filterable_state.h ('K') | « components/variations/study_filtering.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698