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

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

Issue 2010253003: Sending a data saver Pageload metrics pingback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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 0f1d829984539a7ea3b321caf7b12a35eb884376..288fefdc7d0561f98f9cc689ed6b7197ecb7b26d 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
@@ -478,29 +478,32 @@ TEST_F(DataReductionProxyNetworkDelegateTest, RequestDataConfigurations) {
data_reduction_proxy_info.UseNamedProxy(data_reduction_proxy);
else
data_reduction_proxy_info.UseNamedProxy("port.of.other.proxy");
// Main frame loaded. Lo-Fi should be used.
net::HttpRequestHeaders headers;
net::ProxyRetryInfoMap proxy_retry_info;
std::unique_ptr<net::URLRequest> request = context()->CreateRequest(
GURL("http://www.google.com/"), net::RequestPriority::IDLE, nullptr);
lofi_decider()->SetIsUsingLoFiMode(test.lofi_on);
+ io_data()->request_options()->SetSecureSession("fake-session");
network_delegate()->NotifyBeforeSendHeaders(
request.get(), data_reduction_proxy_info, proxy_retry_info, &headers);
DataReductionProxyData* data =
DataReductionProxyData::GetData(*request.get());
if (!test.used_data_reduction_proxy) {
EXPECT_FALSE(data);
} else {
EXPECT_TRUE(data);
EXPECT_TRUE(data->used_data_reduction_proxy());
+ EXPECT_EQ(GURL("http://www.google.com/"), data->original_request_url());
+ EXPECT_EQ("fake-session", data->session_key());
EXPECT_EQ(test.lofi_on, data->lofi_requested());
}
}
}
TEST_F(DataReductionProxyNetworkDelegateTest,
RequestDataHoldbackConfigurations) {
const struct {
bool data_reduction_proxy_enabled;
bool used_direct;

Powered by Google App Engine
This is Rietveld 408576698