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

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

Issue 2934543002: Sending a page load pingback to data saver for holdback users (Closed)
Patch Set: tbansl comment Created 3 years, 6 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_network_delegate_unittest.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc
index fe69c111390312dfb352b2f49e1d19769553921e..52254e3c44bc13968d5725f02419a73c93c4b156 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc
@@ -1144,6 +1144,8 @@ TEST_F(DataReductionProxyNetworkDelegateTest,
true, true,
},
};
+ test_network_quality_estimator()->set_effective_connection_type(
+ net::EFFECTIVE_CONNECTION_TYPE_4G);
base::FieldTrialList field_trial_list(nullptr);
ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial(
"DataCompressionProxyHoldback", "Enabled"));
@@ -1157,7 +1159,9 @@ TEST_F(DataReductionProxyNetworkDelegateTest,
std::unique_ptr<net::URLRequest> request =
context()->CreateRequest(GURL(kTestURL), net::RequestPriority::IDLE,
nullptr, TRAFFIC_ANNOTATION_FOR_TESTS);
+ request->SetLoadFlags(net::LOAD_MAIN_FRAME_DEPRECATED);
request->set_method("GET");
+ io_data()->request_options()->SetSecureSession("fake-session");
net::HttpRequestHeaders headers;
net::ProxyRetryInfoMap proxy_retry_info;
network_delegate()->NotifyBeforeSendHeaders(
@@ -1169,6 +1173,11 @@ TEST_F(DataReductionProxyNetworkDelegateTest,
} else {
EXPECT_TRUE(data);
EXPECT_TRUE(data->used_data_reduction_proxy());
+ EXPECT_EQ("fake-session", data->session_key());
+ EXPECT_EQ(GURL(kTestURL), data->request_url());
+ EXPECT_EQ(net::EFFECTIVE_CONNECTION_TYPE_4G,
+ data->effective_connection_type());
+ EXPECT_TRUE(data->page_id());
}
}
}

Powered by Google App Engine
This is Rietveld 408576698