diff options
author | lgarron <lgarron@chromium.org> | 2014-12-04 16:51:34 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-05 00:52:05 +0000 |
commit | a91df87fa1cf9413989c0ac446f52b96103f6f57 (patch) | |
tree | 843c2a0ad0d3923d636df27487126a0a341309b3 | |
parent | 9261dde33f1939f432cafe6f9654efedba4dc252 (diff) | |
download | chromium_src-a91df87fa1cf9413989c0ac446f52b96103f6f57.zip chromium_src-a91df87fa1cf9413989c0ac446f52b96103f6f57.tar.gz chromium_src-a91df87fa1cf9413989c0ac446f52b96103f6f57.tar.bz2 |
Change three SPDY tests to use port 8080 instead of 443.
- HttpNetworkTransactionTest.DoNotUseSpdySessionForHttpOverTunnel
- HttpNetworkTransactionTest.DoNotUseSpdySessionForHttp
- HttpNetworkTransactionTest.UseSpdySessionForHttpWhenForced
The use of port 443 caused the trybots for https://crrev.com/770343003/ to fail.
BUG=
Review URL: https://codereview.chromium.org/777293003
Cr-Commit-Position: refs/heads/master@{#306946}
-rw-r--r-- | net/http/http_network_transaction_unittest.cc | 62 | ||||
-rw-r--r-- | net/http/http_proxy_client_socket_pool_unittest.cc | 20 | ||||
-rw-r--r-- | net/spdy/spdy_test_util_common.cc | 9 | ||||
-rw-r--r-- | net/spdy/spdy_test_util_common.h | 3 |
4 files changed, 52 insertions, 42 deletions
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc index eacd06c..a0248fe 100644 --- a/net/http/http_network_transaction_unittest.cc +++ b/net/http/http_network_transaction_unittest.cc @@ -3262,8 +3262,8 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyConnectHttps) { new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // CONNECT to www.google.com:443 via SPDY - scoped_ptr<SpdyFrame> connect(spdy_util_.ConstructSpdyConnect(NULL, 0, 1, - LOWEST)); + scoped_ptr<SpdyFrame> connect(spdy_util_.ConstructSpdyConnect( + NULL, 0, 1, LOWEST, HostPortPair("www.google.com", 443))); // fetch https://www.google.com/ via HTTP const char get[] = "GET / HTTP/1.1\r\n" @@ -3349,8 +3349,8 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyConnectSpdy) { new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // CONNECT to www.google.com:443 via SPDY - scoped_ptr<SpdyFrame> connect(spdy_util_.ConstructSpdyConnect(NULL, 0, 1, - LOWEST)); + scoped_ptr<SpdyFrame> connect(spdy_util_.ConstructSpdyConnect( + NULL, 0, 1, LOWEST, HostPortPair("www.google.com", 443))); // fetch https://www.google.com/ via SPDY const char* const kMyUrl = "https://www.google.com/"; scoped_ptr<SpdyFrame> get( @@ -3438,8 +3438,8 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyConnectFailure) { new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // CONNECT to www.google.com:443 via SPDY - scoped_ptr<SpdyFrame> connect(spdy_util_.ConstructSpdyConnect(NULL, 0, 1, - LOWEST)); + scoped_ptr<SpdyFrame> connect(spdy_util_.ConstructSpdyConnect( + NULL, 0, 1, LOWEST, HostPortPair("www.google.com", 443))); scoped_ptr<SpdyFrame> get( spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); @@ -3501,8 +3501,8 @@ TEST_P(HttpNetworkTransactionTest, request2.load_flags = 0; // CONNECT to www.google.com:443 via SPDY. - scoped_ptr<SpdyFrame> connect1(spdy_util_.ConstructSpdyConnect(NULL, 0, 1, - LOWEST)); + scoped_ptr<SpdyFrame> connect1(spdy_util_.ConstructSpdyConnect( + NULL, 0, 1, LOWEST, HostPortPair("www.google.com", 443))); scoped_ptr<SpdyFrame> conn_resp1( spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1)); @@ -3651,8 +3651,8 @@ TEST_P(HttpNetworkTransactionTest, request2.load_flags = 0; // CONNECT to www.google.com:443 via SPDY. - scoped_ptr<SpdyFrame> connect1(spdy_util_.ConstructSpdyConnect(NULL, 0, 1, - LOWEST)); + scoped_ptr<SpdyFrame> connect1(spdy_util_.ConstructSpdyConnect( + NULL, 0, 1, LOWEST, HostPortPair("www.google.com", 443))); scoped_ptr<SpdyFrame> conn_resp1( spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1)); @@ -6220,8 +6220,8 @@ TEST_P(HttpNetworkTransactionTest, RedirectOfHttpsConnectViaSpdyProxy) { request.url = GURL("https://www.google.com/"); request.load_flags = 0; - scoped_ptr<SpdyFrame> conn(spdy_util_.ConstructSpdyConnect(NULL, 0, 1, - LOWEST)); + scoped_ptr<SpdyFrame> conn(spdy_util_.ConstructSpdyConnect( + NULL, 0, 1, LOWEST, HostPortPair("www.google.com", 443))); scoped_ptr<SpdyFrame> goaway( spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite data_writes[] = { @@ -6329,8 +6329,8 @@ TEST_P(HttpNetworkTransactionTest, request.url = GURL("https://www.google.com/"); request.load_flags = 0; - scoped_ptr<SpdyFrame> conn(spdy_util_.ConstructSpdyConnect(NULL, 0, 1, - LOWEST)); + scoped_ptr<SpdyFrame> conn(spdy_util_.ConstructSpdyConnect( + NULL, 0, 1, LOWEST, HostPortPair("www.google.com", 443))); scoped_ptr<SpdyFrame> rst( spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite data_writes[] = { @@ -6396,8 +6396,8 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthSpdyProxy) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); // Since we have proxy, should try to establish tunnel. - scoped_ptr<SpdyFrame> req(spdy_util_.ConstructSpdyConnect(NULL, 0, 1, - LOWEST)); + scoped_ptr<SpdyFrame> req(spdy_util_.ConstructSpdyConnect( + NULL, 0, 1, LOWEST, HostPortPair("www.google.com", 443))); scoped_ptr<SpdyFrame> rst( spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); @@ -6407,7 +6407,8 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthSpdyProxy) { "proxy-authorization", "Basic Zm9vOmJhcg==", }; scoped_ptr<SpdyFrame> connect2(spdy_util_.ConstructSpdyConnect( - kAuthCredentials, arraysize(kAuthCredentials) / 2, 3, LOWEST)); + kAuthCredentials, arraysize(kAuthCredentials) / 2, 3, LOWEST, + HostPortPair("www.google.com", 443))); // fetch https://www.google.com/ via HTTP const char get[] = "GET / HTTP/1.1\r\n" "Host: www.google.com\r\n" @@ -11312,8 +11313,8 @@ WRAPPED_TEST_P(HttpNetworkTransactionTest, #undef MAYBE_UseIPConnectionPoolingWithHostCacheExpiration TEST_P(HttpNetworkTransactionTest, DoNotUseSpdySessionForHttp) { - const std::string https_url = "https://www.google.com/"; - const std::string http_url = "http://www.google.com:443/"; + const std::string https_url = "https://www.google.com:8080/"; + const std::string http_url = "http://www.google.com:8080/"; // SPDY GET for HTTPS URL scoped_ptr<SpdyFrame> req1( @@ -11339,10 +11340,10 @@ TEST_P(HttpNetworkTransactionTest, DoNotUseSpdySessionForHttp) { // HTTP GET for the HTTP URL MockWrite writes2[] = { - MockWrite(ASYNC, 4, - "GET / HTTP/1.1\r\n" - "Host: www.google.com:443\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite(ASYNC, 4, + "GET / HTTP/1.1\r\n" + "Host: www.google.com:8080\r\n" + "Connection: keep-alive\r\n\r\n"), }; MockRead reads2[] = { @@ -11393,12 +11394,13 @@ TEST_P(HttpNetworkTransactionTest, DoNotUseSpdySessionForHttp) { } TEST_P(HttpNetworkTransactionTest, DoNotUseSpdySessionForHttpOverTunnel) { - const std::string https_url = "https://www.google.com/"; - const std::string http_url = "http://www.google.com:443/"; + const std::string https_url = "https://www.google.com:8080/"; + const std::string http_url = "http://www.google.com:8080/"; // SPDY GET for HTTPS URL (through CONNECT tunnel) - scoped_ptr<SpdyFrame> connect(spdy_util_.ConstructSpdyConnect(NULL, 0, 1, - LOWEST)); + const HostPortPair host_port_pair("www.google.com", 8080); + scoped_ptr<SpdyFrame> connect( + spdy_util_.ConstructSpdyConnect(NULL, 0, 1, LOWEST, host_port_pair)); scoped_ptr<SpdyFrame> req1( spdy_util_.ConstructSpdyGet(https_url.c_str(), false, 1, LOWEST)); scoped_ptr<SpdyFrame> wrapped_req1( @@ -11408,7 +11410,7 @@ TEST_P(HttpNetworkTransactionTest, DoNotUseSpdySessionForHttpOverTunnel) { SpdyHeaderBlock req2_block; req2_block[spdy_util_.GetMethodKey()] = "GET"; req2_block[spdy_util_.GetPathKey()] = "/"; - req2_block[spdy_util_.GetHostKey()] = "www.google.com:443"; + req2_block[spdy_util_.GetHostKey()] = "www.google.com:8080"; req2_block[spdy_util_.GetSchemeKey()] = "http"; spdy_util_.MaybeAddVersionHeader(&req2_block); scoped_ptr<SpdyFrame> req2( @@ -11505,8 +11507,8 @@ TEST_P(HttpNetworkTransactionTest, DoNotUseSpdySessionForHttpOverTunnel) { TEST_P(HttpNetworkTransactionTest, UseSpdySessionForHttpWhenForced) { session_deps_.force_spdy_always = true; - const std::string https_url = "https://www.google.com/"; - const std::string http_url = "http://www.google.com:443/"; + const std::string https_url = "https://www.google.com:8080/"; + const std::string http_url = "http://www.google.com:8080/"; // SPDY GET for HTTPS URL scoped_ptr<SpdyFrame> req1( diff --git a/net/http/http_proxy_client_socket_pool_unittest.cc b/net/http/http_proxy_client_socket_pool_unittest.cc index f818432..909da62 100644 --- a/net/http/http_proxy_client_socket_pool_unittest.cc +++ b/net/http/http_proxy_client_socket_pool_unittest.cc @@ -393,8 +393,8 @@ TEST_P(HttpProxyClientSocketPoolTest, NeedAuth) { MockRead(ASYNC, 3, "Content-Length: 10\r\n\r\n"), MockRead(ASYNC, 4, "0123456789"), }; - scoped_ptr<SpdyFrame> req( - spdy_util_.ConstructSpdyConnect(NULL, 0, 1, LOW)); + scoped_ptr<SpdyFrame> req(spdy_util_.ConstructSpdyConnect( + NULL, 0, 1, LOW, HostPortPair("www.google.com", 443))); scoped_ptr<SpdyFrame> rst( spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite spdy_writes[] = { @@ -502,7 +502,8 @@ TEST_P(HttpProxyClientSocketPoolTest, AsyncHaveAuth) { }; scoped_ptr<SpdyFrame> req( - spdy_util_.ConstructSpdyConnect(kAuthHeaders, kAuthHeadersSize, 1, LOW)); + spdy_util_.ConstructSpdyConnect(kAuthHeaders, kAuthHeadersSize, 1, LOW, + HostPortPair("www.google.com", 443))); MockWrite spdy_writes[] = { CreateMockWrite(*req, 0, ASYNC) }; @@ -544,8 +545,8 @@ TEST_P(HttpProxyClientSocketPoolTest, return; scoped_ptr<SpdyFrame> req( - spdy_util_.ConstructSpdyConnect(kAuthHeaders, kAuthHeadersSize, - 1, MEDIUM)); + spdy_util_.ConstructSpdyConnect(kAuthHeaders, kAuthHeadersSize, 1, MEDIUM, + HostPortPair("www.google.com", 443))); MockWrite spdy_writes[] = { CreateMockWrite(*req, 0, ASYNC) }; @@ -651,7 +652,8 @@ TEST_P(HttpProxyClientSocketPoolTest, TunnelUnexpectedClose) { MockRead(ASYNC, ERR_CONNECTION_CLOSED, 2), }; scoped_ptr<SpdyFrame> req( - spdy_util_.ConstructSpdyConnect(kAuthHeaders, kAuthHeadersSize, 1, LOW)); + spdy_util_.ConstructSpdyConnect(kAuthHeaders, kAuthHeadersSize, 1, LOW, + HostPortPair("www.google.com", 443))); MockWrite spdy_writes[] = { CreateMockWrite(*req, 0, ASYNC) }; @@ -725,7 +727,8 @@ TEST_P(HttpProxyClientSocketPoolTest, TunnelSetupError) { MockRead(ASYNC, 1, "HTTP/1.1 304 Not Modified\r\n\r\n"), }; scoped_ptr<SpdyFrame> req( - spdy_util_.ConstructSpdyConnect(kAuthHeaders, kAuthHeadersSize, 1, LOW)); + spdy_util_.ConstructSpdyConnect(kAuthHeaders, kAuthHeadersSize, 1, LOW, + HostPortPair("www.google.com", 443))); scoped_ptr<SpdyFrame> rst( spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite spdy_writes[] = { @@ -776,7 +779,8 @@ TEST_P(HttpProxyClientSocketPoolTest, TunnelSetupRedirect) { MockRead(ASYNC, 1, responseText.c_str()), }; scoped_ptr<SpdyFrame> req( - spdy_util_.ConstructSpdyConnect(kAuthHeaders, kAuthHeadersSize, 1, LOW)); + spdy_util_.ConstructSpdyConnect(kAuthHeaders, kAuthHeadersSize, 1, LOW, + HostPortPair("www.google.com", 443))); scoped_ptr<SpdyFrame> rst( spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); diff --git a/net/spdy/spdy_test_util_common.cc b/net/spdy/spdy_test_util_common.cc index f0765a0..490af6b 100644 --- a/net/spdy/spdy_test_util_common.cc +++ b/net/spdy/spdy_test_util_common.cc @@ -969,11 +969,14 @@ SpdyFrame* SpdyTestUtil::ConstructSpdyConnect( const char* const extra_headers[], int extra_header_count, int stream_id, - RequestPriority priority) const { + RequestPriority priority, + const HostPortPair& host_port_pair) const { SpdyHeaderBlock block; block[GetMethodKey()] = "CONNECT"; - block[GetPathKey()] = "www.google.com:443"; - block[GetHostKey()] = "www.google.com"; + block[GetPathKey()] = host_port_pair.ToString(); + block[GetHostKey()] = (host_port_pair.port() == 443) + ? host_port_pair.host() + : host_port_pair.ToString(); MaybeAddVersionHeader(&block); AppendToHeaderBlock(extra_headers, extra_header_count, &block); return ConstructSpdySyn(stream_id, block, priority, false, false); diff --git a/net/spdy/spdy_test_util_common.h b/net/spdy/spdy_test_util_common.h index 0ee59d44..58e1b00 100644 --- a/net/spdy/spdy_test_util_common.h +++ b/net/spdy/spdy_test_util_common.h @@ -436,7 +436,8 @@ class SpdyTestUtil { SpdyFrame* ConstructSpdyConnect(const char* const extra_headers[], int extra_header_count, int stream_id, - RequestPriority priority) const; + RequestPriority priority, + const HostPortPair& host_port_pair) const; // Constructs a standard SPDY push SYN frame. // |extra_headers| are the extra header-value pairs, which typically |