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

Unified Diff: net/http/http_network_transaction_unittest.cc

Issue 2334623003: Store net::ProxyServer in HttpResponseInfo object (Closed)
Patch Set: PS Created 4 years, 3 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: net/http/http_network_transaction_unittest.cc
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index 2162b8875f4780c848ffb575e04a640c9aeefa9e..60ad96aa7f9db22b800f9ad271e49ed4db2f30aa 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -1063,7 +1063,7 @@ TEST_F(HttpNetworkTransactionTest, TwoIdenticalLocationHeaders) {
std::string url;
EXPECT_TRUE(response->headers->IsRedirect(&url));
EXPECT_EQ("http://good.com/", url);
- EXPECT_TRUE(response->proxy_server.IsEmpty());
+ EXPECT_FALSE(response->proxy_server.is_valid());
}
// Checks that two distinct Location headers result in an error.
@@ -1127,7 +1127,7 @@ TEST_F(HttpNetworkTransactionTest, Head) {
EXPECT_TRUE(response->headers);
EXPECT_EQ(1234, response->headers->GetContentLength());
EXPECT_EQ("HTTP/1.1 404 Not Found", response->headers->GetStatusLine());
- EXPECT_TRUE(response->proxy_server.IsEmpty());
+ EXPECT_FALSE(response->proxy_server.is_valid());
EXPECT_TRUE(headers_handler.observed_before_headers_sent());
EXPECT_FALSE(headers_handler.observed_before_headers_sent_with_proxy());
@@ -1184,7 +1184,7 @@ TEST_F(HttpNetworkTransactionTest, ReuseConnection) {
EXPECT_TRUE(response->headers);
EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine());
- EXPECT_TRUE(response->proxy_server.IsEmpty());
+ EXPECT_FALSE(response->proxy_server.is_valid());
std::string response_data;
rv = ReadTransaction(&trans, &response_data);
@@ -12128,8 +12128,9 @@ TEST_F(HttpNetworkTransactionTest, ProxyGet) {
EXPECT_EQ(200, response->headers->response_code());
EXPECT_EQ(100, response->headers->GetContentLength());
EXPECT_TRUE(response->was_fetched_via_proxy);
- EXPECT_TRUE(
- response->proxy_server.Equals(HostPortPair::FromString("myproxy:70")));
+ EXPECT_EQ(ProxyServer(ProxyServer::SCHEME_HTTP,
+ HostPortPair::FromString("myproxy:70")),
+ response->proxy_server);
EXPECT_TRUE(headers_handler.observed_before_headers_sent());
EXPECT_TRUE(headers_handler.observed_before_headers_sent_with_proxy());
EXPECT_EQ("myproxy:70", headers_handler.observed_proxy_server_uri());
@@ -12210,8 +12211,9 @@ TEST_F(HttpNetworkTransactionTest, ProxyTunnelGet) {
EXPECT_EQ(100, response->headers->GetContentLength());
EXPECT_TRUE(HttpVersion(1, 1) == response->headers->GetHttpVersion());
EXPECT_TRUE(response->was_fetched_via_proxy);
- EXPECT_TRUE(
- response->proxy_server.Equals(HostPortPair::FromString("myproxy:70")));
+ EXPECT_EQ(ProxyServer(ProxyServer::SCHEME_HTTP,
+ HostPortPair::FromString("myproxy:70")),
+ response->proxy_server);
EXPECT_TRUE(headers_handler.observed_before_headers_sent());
EXPECT_TRUE(headers_handler.observed_before_headers_sent_with_proxy());
EXPECT_EQ("myproxy:70", headers_handler.observed_proxy_server_uri());
@@ -12288,8 +12290,9 @@ TEST_F(HttpNetworkTransactionTest, ProxyTunnelGetIPv6) {
EXPECT_EQ(100, response->headers->GetContentLength());
EXPECT_TRUE(HttpVersion(1, 1) == response->headers->GetHttpVersion());
EXPECT_TRUE(response->was_fetched_via_proxy);
- EXPECT_TRUE(
- response->proxy_server.Equals(HostPortPair::FromString("myproxy:70")));
+ EXPECT_EQ(ProxyServer(ProxyServer::SCHEME_HTTP,
+ HostPortPair::FromString("myproxy:70")),
+ response->proxy_server);
LoadTimingInfo load_timing_info;
EXPECT_TRUE(trans.GetLoadTimingInfo(&load_timing_info));

Powered by Google App Engine
This is Rietveld 408576698