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

Unified Diff: net/http/http_network_layer_unittest.cc

Issue 156373002: Support for new data reduction proxy via header (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed compilation error on unsupported platforms Created 6 years, 10 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 | « chrome/renderer/page_load_histograms.cc ('k') | net/http/http_network_transaction.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_layer_unittest.cc
diff --git a/net/http/http_network_layer_unittest.cc b/net/http/http_network_layer_unittest.cc
index 7fdfbc0efcc07cfd2e9cc0c60f676d682eed3ae5..2adbff0a27a469fc1690f440b486c181c81aaaf1 100644
--- a/net/http/http_network_layer_unittest.cc
+++ b/net/http/http_network_layer_unittest.cc
@@ -623,7 +623,7 @@ TEST_F(HttpNetworkLayerTest, ServerFallbackWithProxyTimedBypass) {
MockRead("HTTP/1.1 200 OK\r\n"
"Connection: keep-alive\r\n"
"Chrome-Proxy: bypass=86400\r\n"
- "Via: 1.1 Chrome Compression Proxy\r\n\r\n"),
+ "Via: 1.1 Chrome-Compression-Proxy\r\n\r\n"),
MockRead("Bypass message"),
MockRead(SYNCHRONOUS, OK),
};
@@ -681,7 +681,27 @@ TEST_F(HttpNetworkLayerTest, NoServerFallbackWithChainedViaHeader) {
MockRead data_reads[] = {
MockRead("HTTP/1.1 200 OK\r\n"
"Connection: keep-alive\r\n"
- "Via: 1.1 Chrome Compression Proxy, 1.0 some-other-proxy\r\n\r\n"),
+ "Via: 1.1 Chrome-Compression-Proxy, 1.0 some-other-proxy\r\n\r\n"),
+ MockRead("Bypass message"),
+ MockRead(SYNCHRONOUS, OK),
+ };
+
+ TestProxyFallbackByMethodWithMockReads(chrome_proxy, std::string(),
+ data_reads, arraysize(data_reads),
+ "GET", std::string(), false, 0);
+}
+
+TEST_F(HttpNetworkLayerTest, NoServerFallbackWithDeprecatedViaHeader) {
+ // Verify that Chrome will not be induced to bypass the Chrome proxy when
+ // the Chrome Proxy via header is present, even if that header is chained.
+ std::string chrome_proxy = GetChromeProxy();
+ ConfigureTestDependencies(ProxyService::CreateFixedFromPacResult(
+ "PROXY " + chrome_proxy + "; PROXY good:8080"));
+
+ MockRead data_reads[] = {
+ MockRead("HTTP/1.1 200 OK\r\n"
+ "Connection: keep-alive\r\n"
+ "Via: 1.1 Chrome Compression Proxy\r\n\r\n"),
MockRead("Bypass message"),
MockRead(SYNCHRONOUS, OK),
};
@@ -706,7 +726,7 @@ TEST_F(HttpNetworkLayerTest, ServerFallbackWithProxyTimedBypassAll) {
MockRead("HTTP/1.1 200 OK\r\n"
"Connection: keep-alive\r\n"
"Chrome-Proxy: block=86400\r\n"
- "Via: 1.1 Chrome Compression Proxy\r\n\r\n"),
+ "Via: 1.1 Chrome-Compression-Proxy\r\n\r\n"),
MockRead("Bypass message"),
MockRead(SYNCHRONOUS, OK),
};
« no previous file with comments | « chrome/renderer/page_load_histograms.cc ('k') | net/http/http_network_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698