Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options_unittest.cc |
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options_unittest.cc |
index 511f8d993e53832865d5c97d8a1d40ca636dd02e..4f864cea8d3ce0bed70bdf45a651ddd1fcb0f1ab 100644 |
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options_unittest.cc |
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options_unittest.cc |
@@ -154,11 +154,10 @@ class DataReductionProxyRequestOptionsTest : public testing::Test { |
request_options_->Init(); |
} |
- void CreateRequest(int load_flags) { |
+ void CreateRequest() { |
net::URLRequestContext* context = |
test_context_->request_context_getter()->GetURLRequestContext(); |
request_ = context->CreateRequest(GURL(), net::DEFAULT_PRIORITY, nullptr); |
- request_->SetLoadFlags(load_flags); |
} |
TestDataReductionProxyParams* params() { |
@@ -291,8 +290,11 @@ TEST_F(DataReductionProxyRequestOptionsTest, LoFiOnThroughCommandLineSwitch) { |
SetHeaderExpectations(kExpectedSession, kExpectedCredentials, std::string(), |
kClientStr, std::string(), std::string(), std::string(), |
std::vector<std::string>(), &expected_header); |
- |
- test_context_->config()->UpdateLoFiStatusOnMainFrameRequest(false, nullptr); |
+ CreateRequest(); |
+ request_->set_lofi_state( |
+ test_context_->config()->ShouldTurnOnLoFiOnMainFrameRequest(nullptr) |
+ ? net::LOFI_ON |
+ : net::LOFI_OFF); |
CreateRequestOptions(kBogusVersion); |
VerifyExpectedHeader(params()->DefaultOrigin(), expected_header); |
@@ -306,7 +308,10 @@ TEST_F(DataReductionProxyRequestOptionsTest, LoFiOnThroughCommandLineSwitch) { |
kClientStr, std::string(), std::string(), "low", |
std::vector<std::string>(), &expected_header); |
- test_context_->config()->UpdateLoFiStatusOnMainFrameRequest(false, nullptr); |
+ request_->set_lofi_state( |
+ test_context_->config()->ShouldTurnOnLoFiOnMainFrameRequest(nullptr) |
+ ? net::LOFI_ON |
+ : net::LOFI_OFF); |
CreateRequestOptions(kBogusVersion); |
VerifyExpectedHeader(params()->DefaultOrigin(), expected_header); |
} |
@@ -355,8 +360,12 @@ TEST_F(DataReductionProxyRequestOptionsTest, AutoLoFi) { |
test_context_->config()->SetNetworkProhibitivelySlow( |
tests[i].network_prohibitively_slow); |
+ CreateRequest(); |
// Force update Lo-Fi status. |
- test_context_->config()->UpdateLoFiStatusOnMainFrameRequest(false, nullptr); |
+ request_->set_lofi_state( |
+ test_context_->config()->ShouldTurnOnLoFiOnMainFrameRequest(nullptr) |
+ ? net::LOFI_ON |
+ : net::LOFI_OFF); |
CreateRequestOptions(kBogusVersion); |
VerifyExpectedHeader(params()->DefaultOrigin(), expected_header); |
@@ -433,8 +442,12 @@ TEST_F(DataReductionProxyRequestOptionsTest, SlowConnectionsFlag) { |
test_context_->config()->SetNetworkProhibitivelySlow( |
tests[i].network_prohibitively_slow); |
+ CreateRequest(); |
// Force update Lo-Fi status. |
- test_context_->config()->UpdateLoFiStatusOnMainFrameRequest(false, nullptr); |
+ request_->set_lofi_state( |
+ test_context_->config()->ShouldTurnOnLoFiOnMainFrameRequest(nullptr) |
+ ? net::LOFI_ON |
+ : net::LOFI_OFF); |
CreateRequestOptions(kBogusVersion); |
VerifyExpectedHeader(params()->DefaultOrigin(), expected_header); |