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

Unified Diff: components/variations/study_filtering_unittest.cc

Issue 2970093002: Add variations filtering for is_low_end_device. (Closed)
Patch Set: Address comments. 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
« no previous file with comments | « components/variations/study_filtering.cc ('k') | no next file » | 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 1d70c48c8cf04ef5f78ca8781f783a95dfb375c6..c9728e4fddc9fe6915e4dd8cceb17b05a90dd5fc 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 value.
+ 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);
« no previous file with comments | « components/variations/study_filtering.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698