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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_unittest.cc

Issue 1310743003: Consistently use LoFi for an entire page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test fixes Created 5 years, 4 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/data_reduction_proxy/core/browser/data_reduction_proxy_settings_unittest.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_unittest.cc
index 38143623c515c7894fdb2ab1108a853023c46b2b..5cb0e83df68077ce73c1efebf79a7459b3b564ec 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_unittest.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_unittest.cc
@@ -337,8 +337,7 @@ TEST_F(DataReductionProxySettingsTest, TestLoFiImplicitOptOutClicksPerSession) {
test_context_->config()->ResetLoFiStatusForTest();
EXPECT_EQ(0, test_context_->pref_service()->GetInteger(
prefs::kLoFiLoadImagesPerSession));
- EXPECT_EQ(LoFiStatus::LOFI_STATUS_TEMPORARILY_OFF,
- test_context_->config()->GetLoFiStatus());
+ EXPECT_FALSE(test_context_->config()->IsLoFiOff());
// Click "Load images" |lo_fi_user_requests_for_images_per_session_| times.
for (int i = 1; i <= settings_->lo_fi_user_requests_for_images_per_session_;
@@ -351,8 +350,7 @@ TEST_F(DataReductionProxySettingsTest, TestLoFiImplicitOptOutClicksPerSession) {
test_context_->RunUntilIdle();
EXPECT_EQ(1, test_context_->pref_service()->GetInteger(
prefs::kLoFiConsecutiveSessionDisables));
- EXPECT_EQ(LoFiStatus::LOFI_STATUS_OFF,
- test_context_->config()->GetLoFiStatus());
+ EXPECT_TRUE(test_context_->config()->IsLoFiOff());
// Reset the opt out pref values and config Lo-Fi status as if we're starting
// a new session.
@@ -360,8 +358,7 @@ TEST_F(DataReductionProxySettingsTest, TestLoFiImplicitOptOutClicksPerSession) {
settings_->data_reduction_proxy_service_->InitializeLoFiPrefs();
EXPECT_EQ(0, test_context_->pref_service()->GetInteger(
prefs::kLoFiLoadImagesPerSession));
- EXPECT_EQ(LoFiStatus::LOFI_STATUS_TEMPORARILY_OFF,
- test_context_->config()->GetLoFiStatus());
+ EXPECT_FALSE(test_context_->config()->IsLoFiOff());
// Have a session that doesn't have
// |lo_fi_user_requests_for_images_per_session_| so
@@ -378,8 +375,7 @@ TEST_F(DataReductionProxySettingsTest, TestLoFiImplicitOptOutClicksPerSession) {
// shouldn't have been set to off.
EXPECT_EQ(1, test_context_->pref_service()->GetInteger(
prefs::kLoFiConsecutiveSessionDisables));
- EXPECT_EQ(LoFiStatus::LOFI_STATUS_TEMPORARILY_OFF,
- test_context_->config()->GetLoFiStatus());
+ EXPECT_FALSE(test_context_->config()->IsLoFiOff());
// Start a new session. The consecutive session count should now be reset to
// zero.
@@ -396,16 +392,14 @@ TEST_F(DataReductionProxySettingsTest,
prefs::kLoFiLoadImagesPerSession));
EXPECT_EQ(0, test_context_->pref_service()->GetInteger(
prefs::kLoFiConsecutiveSessionDisables));
- EXPECT_EQ(LoFiStatus::LOFI_STATUS_TEMPORARILY_OFF,
- test_context_->config()->GetLoFiStatus());
+ EXPECT_FALSE(test_context_->config()->IsLoFiOff());
// Disable Lo-Fi for |lo_fi_consecutive_session_disables_|.
for (int i = 1; i <= settings_->lo_fi_consecutive_session_disables_; ++i) {
// Start a new session.
test_context_->config()->ResetLoFiStatusForTest();
settings_->data_reduction_proxy_service_->InitializeLoFiPrefs();
- EXPECT_EQ(LoFiStatus::LOFI_STATUS_TEMPORARILY_OFF,
- test_context_->config()->GetLoFiStatus());
+ EXPECT_FALSE(test_context_->config()->IsLoFiOff());
// Click "Load images" |lo_fi_user_requests_for_images_per_session_| times
// for each session.
@@ -419,8 +413,7 @@ TEST_F(DataReductionProxySettingsTest,
test_context_->RunUntilIdle();
EXPECT_EQ(i, test_context_->pref_service()->GetInteger(
prefs::kLoFiConsecutiveSessionDisables));
- EXPECT_EQ(LoFiStatus::LOFI_STATUS_OFF,
- test_context_->config()->GetLoFiStatus());
+ EXPECT_TRUE(test_context_->config()->IsLoFiOff());
}
// Start a new session. Lo-Fi should be set off.
@@ -429,8 +422,7 @@ TEST_F(DataReductionProxySettingsTest,
test_context_->RunUntilIdle();
EXPECT_EQ(3, test_context_->pref_service()->GetInteger(
prefs::kLoFiConsecutiveSessionDisables));
- EXPECT_EQ(LoFiStatus::LOFI_STATUS_OFF,
- test_context_->config()->GetLoFiStatus());
+ EXPECT_TRUE(test_context_->config()->IsLoFiOff());
// Set the implicit opt out epoch to -1 so that the default value of zero will
// be an increase and the opt out status will be reset.
@@ -443,8 +435,7 @@ TEST_F(DataReductionProxySettingsTest,
test_context_->RunUntilIdle();
EXPECT_EQ(0, test_context_->pref_service()->GetInteger(
prefs::kLoFiConsecutiveSessionDisables));
- EXPECT_EQ(LoFiStatus::LOFI_STATUS_TEMPORARILY_OFF,
- test_context_->config()->GetLoFiStatus());
+ EXPECT_FALSE(test_context_->config()->IsLoFiOff());
}
TEST_F(DataReductionProxySettingsTest, TestLoFiImplicitOptOutHistograms) {

Powered by Google App Engine
This is Rietveld 408576698