diff options
author | bnc <bnc@chromium.org> | 2015-04-21 15:11:23 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-21 22:11:42 +0000 |
commit | ce36dca29b74d47193437dfa2df81b5ced67018a (patch) | |
tree | 87f93fc662472711306817aaeca5fb142e9f8362 /net | |
parent | d1faeb2eae9b80c663affd94dd2acbac04a1548d (diff) | |
download | chromium_src-ce36dca29b74d47193437dfa2df81b5ced67018a.zip chromium_src-ce36dca29b74d47193437dfa2df81b5ced67018a.tar.gz chromium_src-ce36dca29b74d47193437dfa2df81b5ced67018a.tar.bz2 |
Change tests not to use a real domain.
Change tests to use reserved host www.example.org instead of real host
www.google.com. Load spdy_pooling.pem test certificate in some tests. Use
mail.example.org as a hostname which is also covered by the certificate, and
news.example.org for one which is not.
Loading an actual cert to SSLSocketDataProvider is in preparation for https://crrev.com/1074193003, which adds a security check that affects these
tests.
BUG=474217
Review URL: https://codereview.chromium.org/1090943002
Cr-Commit-Position: refs/heads/master@{#326141}
Diffstat (limited to 'net')
-rw-r--r-- | net/http/http_network_transaction_unittest.cc | 1690 | ||||
-rw-r--r-- | net/spdy/spdy_http_stream_unittest.cc | 38 | ||||
-rw-r--r-- | net/spdy/spdy_network_transaction_unittest.cc | 204 | ||||
-rw-r--r-- | net/spdy/spdy_session_unittest.cc | 40 | ||||
-rw-r--r-- | net/spdy/spdy_stream_unittest.cc | 7 | ||||
-rw-r--r-- | net/spdy/spdy_test_util_common.h | 2 |
6 files changed, 1047 insertions, 934 deletions
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc index eb81161..1c677db 100644 --- a/net/http/http_network_transaction_unittest.cc +++ b/net/http/http_network_transaction_unittest.cc @@ -219,7 +219,7 @@ void TestLoadTimingNotReusedWithPac(const net::LoadTimingInfo& load_timing_info, void AddWebSocketHeaders(net::HttpRequestHeaders* headers) { headers->SetHeader("Connection", "Upgrade"); headers->SetHeader("Upgrade", "websocket"); - headers->SetHeader("Origin", "http://www.google.com"); + headers->SetHeader("Origin", "http://www.example.org"); headers->SetHeader("Sec-WebSocket-Version", "13"); headers->SetHeader("Sec-WebSocket-Key", "dGhlIHNhbXBsZSBub25jZQ=="); } @@ -314,7 +314,7 @@ class HttpNetworkTransactionTest HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; BoundTestNetLog log; @@ -376,13 +376,13 @@ class HttpNetworkTransactionTest EXPECT_TRUE(trans->GetFullRequestHeaders(&request_headers)); std::string value; EXPECT_TRUE(request_headers.GetHeader("Host", &value)); - EXPECT_EQ("www.google.com", value); + EXPECT_EQ("www.example.org", value); EXPECT_TRUE(request_headers.GetHeader("Connection", &value)); EXPECT_EQ("keep-alive", value); std::string response_headers; EXPECT_TRUE(GetHeaders(entries[pos].params.get(), &response_headers)); - EXPECT_EQ("['Host: www.google.com','Connection: keep-alive']", + EXPECT_EQ("['Host: www.example.org','Connection: keep-alive']", response_headers); out.totalReceivedBytes = trans->GetTotalReceivedBytes(); @@ -613,7 +613,7 @@ bool CheckBasicServerAuth(const AuthChallengeInfo* auth_challenge) { if (!auth_challenge) return false; EXPECT_FALSE(auth_challenge->is_proxy); - EXPECT_EQ("www.google.com:80", auth_challenge->challenger.ToString()); + EXPECT_EQ("www.example.org:80", auth_challenge->challenger.ToString()); EXPECT_EQ("MyRealm1", auth_challenge->realm); EXPECT_EQ("basic", auth_challenge->scheme); return true; @@ -633,7 +633,7 @@ bool CheckDigestServerAuth(const AuthChallengeInfo* auth_challenge) { if (!auth_challenge) return false; EXPECT_FALSE(auth_challenge->is_proxy); - EXPECT_EQ("www.google.com:80", auth_challenge->challenger.ToString()); + EXPECT_EQ("www.example.org:80", auth_challenge->challenger.ToString()); EXPECT_EQ("digestive", auth_challenge->realm); EXPECT_EQ("digest", auth_challenge->scheme); return true; @@ -1012,7 +1012,7 @@ TEST_P(HttpNetworkTransactionTest, TwoDistinctLocationHeaders) { TEST_P(HttpNetworkTransactionTest, Head) { HttpRequestInfo request; request.method = "HEAD"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -1024,10 +1024,11 @@ TEST_P(HttpNetworkTransactionTest, Head) { base::Unretained(&proxy_headers_handler))); MockWrite data_writes1[] = { - MockWrite("HEAD / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Content-Length: 0\r\n\r\n"), + MockWrite( + "HEAD / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Content-Length: 0\r\n\r\n"), }; MockRead data_reads1[] = { MockRead("HTTP/1.1 404 Not Found\r\n"), @@ -1095,7 +1096,7 @@ TEST_P(HttpNetworkTransactionTest, ReuseConnection) { for (int i = 0; i < 2; ++i) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; scoped_ptr<HttpTransaction> trans( @@ -1558,7 +1559,7 @@ TEST_P(HttpNetworkTransactionTest, SpdyPreconnectErrorAsyncEOF) { TEST_P(HttpNetworkTransactionTest, NonKeepAliveConnectionReset) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -1611,7 +1612,7 @@ TEST_P(HttpNetworkTransactionTest, NonKeepAliveConnectionEOF) { TEST_P(HttpNetworkTransactionTest, ThrottleBeforeNetworkStart) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -1661,7 +1662,7 @@ TEST_P(HttpNetworkTransactionTest, ThrottleBeforeNetworkStart) { TEST_P(HttpNetworkTransactionTest, ThrottleAndCancelBeforeNetworkStart) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -1693,7 +1694,7 @@ TEST_P(HttpNetworkTransactionTest, ThrottleAndCancelBeforeNetworkStart) { TEST_P(HttpNetworkTransactionTest, KeepAliveEarlyClose) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -1734,7 +1735,7 @@ TEST_P(HttpNetworkTransactionTest, KeepAliveEarlyClose) { TEST_P(HttpNetworkTransactionTest, KeepAliveEarlyClose2) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -1883,7 +1884,7 @@ TEST_P(HttpNetworkTransactionTest, KeepAliveAfterUnreadBody) { TEST_P(HttpNetworkTransactionTest, BasicAuth) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; TestNetLog log; @@ -1893,9 +1894,10 @@ TEST_P(HttpNetworkTransactionTest, BasicAuth) { new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes1[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; MockRead data_reads1[] = { @@ -1914,10 +1916,11 @@ TEST_P(HttpNetworkTransactionTest, BasicAuth) { // After calling trans->RestartWithAuth(), this is the request we should // be issuing -- the final header line contains the credentials. MockWrite data_writes2[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), }; // Lastly, the server responds with the actual content. @@ -1984,7 +1987,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuth) { TEST_P(HttpNetworkTransactionTest, DoNotSendAuth) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = net::LOAD_DO_NOT_SEND_AUTH_DATA; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -1992,9 +1995,10 @@ TEST_P(HttpNetworkTransactionTest, DoNotSendAuth) { new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; MockRead data_reads[] = { @@ -2030,7 +2034,7 @@ TEST_P(HttpNetworkTransactionTest, DoNotSendAuth) { TEST_P(HttpNetworkTransactionTest, BasicAuthKeepAlive) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; TestNetLog log; @@ -2038,16 +2042,18 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthKeepAlive) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); MockWrite data_writes1[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), - // After calling trans->RestartWithAuth(), this is the request we should - // be issuing -- the final header line contains the credentials. - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), + // After calling trans->RestartWithAuth(), this is the request we should + // be issuing -- the final header line contains the credentials. + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), }; MockRead data_reads1[] = { @@ -2130,22 +2136,24 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthKeepAlive) { TEST_P(HttpNetworkTransactionTest, BasicAuthKeepAliveNoBody) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); MockWrite data_writes1[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), - // After calling trans->RestartWithAuth(), this is the request we should - // be issuing -- the final header line contains the credentials. - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), + // After calling trans->RestartWithAuth(), this is the request we should + // be issuing -- the final header line contains the credentials. + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), }; MockRead data_reads1[] = { @@ -2206,22 +2214,24 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthKeepAliveNoBody) { TEST_P(HttpNetworkTransactionTest, BasicAuthKeepAliveLargeBody) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); MockWrite data_writes1[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), - // After calling trans->RestartWithAuth(), this is the request we should - // be issuing -- the final header line contains the credentials. - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), + // After calling trans->RestartWithAuth(), this is the request we should + // be issuing -- the final header line contains the credentials. + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), }; // Respond with 5 kb of response body. @@ -2290,21 +2300,23 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthKeepAliveLargeBody) { TEST_P(HttpNetworkTransactionTest, BasicAuthKeepAliveImpatientServer) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); MockWrite data_writes1[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), - // This simulates the seemingly successful write to a closed connection - // if the bug is not fixed. - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), + // This simulates the seemingly successful write to a closed connection + // if the bug is not fixed. + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), }; MockRead data_reads1[] = { @@ -2321,10 +2333,11 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthKeepAliveImpatientServer) { // After calling trans->RestartWithAuth(), this is the request we should // be issuing -- the final header line contains the credentials. MockWrite data_writes2[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), }; // Lastly, the server responds with the actual content. @@ -2376,7 +2389,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthKeepAliveImpatientServer) { TEST_P(HttpNetworkTransactionTest, BasicAuthProxyNoKeepAliveHttp10) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); // when the no authentication data flag is set. request.load_flags = net::LOAD_DO_NOT_SEND_AUTH_DATA; @@ -2390,21 +2403,21 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyNoKeepAliveHttp10) { // Since we have proxy, should try to establish tunnel. MockWrite data_writes1[] = { MockWrite( - "CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" "Proxy-Connection: keep-alive\r\n\r\n"), // After calling trans->RestartWithAuth(), this is the request we should // be issuing -- the final header line contains the credentials. MockWrite( - "CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" "Proxy-Connection: keep-alive\r\n" "Proxy-Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), MockWrite( "GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" + "Host: www.example.org\r\n" "Connection: keep-alive\r\n\r\n"), }; @@ -2494,7 +2507,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyNoKeepAliveHttp10) { TEST_P(HttpNetworkTransactionTest, BasicAuthProxyNoKeepAliveHttp11) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); // when the no authentication data flag is set. request.load_flags = net::LOAD_DO_NOT_SEND_AUTH_DATA; @@ -2507,20 +2520,23 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyNoKeepAliveHttp11) { // Since we have proxy, should try to establish tunnel. MockWrite data_writes1[] = { - MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n\r\n"), + MockWrite( + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n\r\n"), - // After calling trans->RestartWithAuth(), this is the request we should - // be issuing -- the final header line contains the credentials. - MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n" - "Proxy-Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), + // After calling trans->RestartWithAuth(), this is the request we should + // be issuing -- the final header line contains the credentials. + MockWrite( + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n" + "Proxy-Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; // The proxy responds to the connect with a 407, using a persistent @@ -2611,7 +2627,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyNoKeepAliveHttp11) { TEST_P(HttpNetworkTransactionTest, BasicAuthProxyKeepAliveHttp10) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); // Ensure that proxy authentication is attempted even // when the no authentication data flag is set. request.load_flags = net::LOAD_DO_NOT_SEND_AUTH_DATA; @@ -2628,15 +2644,15 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyKeepAliveHttp10) { // Since we have proxy, should try to establish tunnel. MockWrite data_writes1[] = { MockWrite( - "CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" "Proxy-Connection: keep-alive\r\n\r\n"), // After calling trans->RestartWithAuth(), this is the request we should // be issuing -- the final header line contains the credentials. MockWrite( - "CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" "Proxy-Connection: keep-alive\r\n" "Proxy-Authorization: Basic Zm9vOmJheg==\r\n\r\n"), }; @@ -2718,7 +2734,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyKeepAliveHttp10) { TEST_P(HttpNetworkTransactionTest, BasicAuthProxyKeepAliveHttp11) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); // Ensure that proxy authentication is attempted even // when the no authentication data flag is set. request.load_flags = net::LOAD_DO_NOT_SEND_AUTH_DATA; @@ -2734,16 +2750,18 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyKeepAliveHttp11) { // Since we have proxy, should try to establish tunnel. MockWrite data_writes1[] = { - MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n\r\n"), + MockWrite( + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n\r\n"), - // After calling trans->RestartWithAuth(), this is the request we should - // be issuing -- the final header line contains the credentials. - MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n" - "Proxy-Authorization: Basic Zm9vOmJheg==\r\n\r\n"), + // After calling trans->RestartWithAuth(), this is the request we should + // be issuing -- the final header line contains the credentials. + MockWrite( + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n" + "Proxy-Authorization: Basic Zm9vOmJheg==\r\n\r\n"), }; // The proxy responds to the connect with a 407, using a persistent @@ -2822,7 +2840,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyKeepAliveHttp11) { TEST_P(HttpNetworkTransactionTest, BasicAuthProxyCancelTunnel) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); request.load_flags = 0; // Configure against proxy server "myproxy:70". @@ -2835,9 +2853,10 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyCancelTunnel) { // Since we have proxy, should try to establish tunnel. MockWrite data_writes[] = { - MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n\r\n"), + MockWrite( + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n\r\n"), }; // The proxy responds to the connect with a 407. @@ -2881,7 +2900,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyCancelTunnel) { TEST_P(HttpNetworkTransactionTest, SanitizeProxyAuthHeaders) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); request.load_flags = 0; // Configure against proxy server "myproxy:70". @@ -2895,8 +2914,8 @@ TEST_P(HttpNetworkTransactionTest, SanitizeProxyAuthHeaders) { // Since we have proxy, should try to establish tunnel. MockWrite data_writes[] = { MockWrite( - "CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" "Proxy-Connection: keep-alive\r\n\r\n"), }; @@ -2944,7 +2963,7 @@ TEST_P(HttpNetworkTransactionTest, SanitizeProxyAuthHeaders) { TEST_P(HttpNetworkTransactionTest, UnexpectedProxyAuth) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; // We are using a DIRECT connection (i.e. no proxy) for this session. @@ -2953,9 +2972,10 @@ TEST_P(HttpNetworkTransactionTest, UnexpectedProxyAuth) { new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes1[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; MockRead data_reads1[] = { @@ -2990,7 +3010,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsServerRequestsProxyAuthThroughProxy) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); session_deps_.proxy_service.reset(ProxyService::CreateFixed("myproxy:70")); BoundTestNetLog log; @@ -2999,13 +3019,15 @@ TEST_P(HttpNetworkTransactionTest, // Since we have proxy, should try to establish tunnel. MockWrite data_writes1[] = { - MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n\r\n"), + MockWrite( + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n\r\n"), - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; MockRead data_reads1[] = { @@ -3048,11 +3070,11 @@ TEST_P(HttpNetworkTransactionTest, TEST_P(HttpNetworkTransactionTest, HttpProxyLoadTimingNoPacTwoRequests) { HttpRequestInfo request1; request1.method = "GET"; - request1.url = GURL("https://www.google.com/1"); + request1.url = GURL("https://www.example.org/1"); HttpRequestInfo request2; request2.method = "GET"; - request2.url = GURL("https://www.google.com/2"); + request2.url = GURL("https://www.example.org/2"); // Configure against proxy server "myproxy:70". session_deps_.proxy_service.reset( @@ -3063,17 +3085,20 @@ TEST_P(HttpNetworkTransactionTest, HttpProxyLoadTimingNoPacTwoRequests) { // Since we have proxy, should try to establish tunnel. MockWrite data_writes1[] = { - MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n\r\n"), + MockWrite( + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n\r\n"), - MockWrite("GET /1 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET /1 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), - MockWrite("GET /2 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET /2 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; // The proxy responds to the connect with a 407, using a persistent @@ -3146,11 +3171,11 @@ TEST_P(HttpNetworkTransactionTest, HttpProxyLoadTimingNoPacTwoRequests) { TEST_P(HttpNetworkTransactionTest, HttpProxyLoadTimingWithPacTwoRequests) { HttpRequestInfo request1; request1.method = "GET"; - request1.url = GURL("https://www.google.com/1"); + request1.url = GURL("https://www.example.org/1"); HttpRequestInfo request2; request2.method = "GET"; - request2.url = GURL("https://www.google.com/2"); + request2.url = GURL("https://www.example.org/2"); // Configure against proxy server "myproxy:70". session_deps_.proxy_service.reset( @@ -3161,17 +3186,20 @@ TEST_P(HttpNetworkTransactionTest, HttpProxyLoadTimingWithPacTwoRequests) { // Since we have proxy, should try to establish tunnel. MockWrite data_writes1[] = { - MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n\r\n"), + MockWrite( + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n\r\n"), - MockWrite("GET /1 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET /1 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), - MockWrite("GET /2 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET /2 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; // The proxy responds to the connect with a 407, using a persistent @@ -3245,7 +3273,7 @@ TEST_P(HttpNetworkTransactionTest, HttpProxyLoadTimingWithPacTwoRequests) { TEST_P(HttpNetworkTransactionTest, HttpsProxyGet) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); // Configure against https proxy server "proxy:70". session_deps_.proxy_service.reset(ProxyService::CreateFixed( @@ -3256,9 +3284,10 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxyGet) { // Since we have proxy, should use full url MockWrite data_writes1[] = { - MockWrite("GET http://www.google.com/ HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET http://www.example.org/ HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n\r\n"), }; MockRead data_reads1[] = { @@ -3306,7 +3335,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxyGet) { TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyGet) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; // Configure against https proxy server "proxy:70". @@ -3316,7 +3345,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyGet) { session_deps_.net_log = log.bound().net_log(); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); - // fetch http://www.google.com/ via SPDY + // fetch http://www.example.org/ via SPDY scoped_ptr<SpdyFrame> req( spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, false)); MockWrite spdy_writes[] = { CreateMockWrite(*req) }; @@ -3371,7 +3400,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyGet) { TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyGetWithSessionRace) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; // Configure SPDY proxy server "proxy:70". @@ -3381,7 +3410,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyGetWithSessionRace) { session_deps_.net_log = log.bound().net_log(); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); - // Fetch http://www.google.com/ through the SPDY proxy. + // Fetch http://www.example.org/ through the SPDY proxy. scoped_ptr<SpdyFrame> req( spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, false)); MockWrite spdy_writes[] = {CreateMockWrite(*req)}; @@ -3445,7 +3474,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyGetWithSessionRace) { TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyGetWithProxyAuth) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; // Configure against https proxy server "myproxy:70". @@ -3548,7 +3577,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyGetWithProxyAuth) { TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyConnectHttps) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); request.load_flags = 0; // Configure against https proxy server "proxy:70". @@ -3561,14 +3590,15 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyConnectHttps) { scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); - // CONNECT to www.google.com:443 via SPDY + // CONNECT to www.example.org:443 via SPDY scoped_ptr<SpdyFrame> connect(spdy_util_.ConstructSpdyConnect( - NULL, 0, 1, LOWEST, HostPortPair("www.google.com", 443))); - // fetch https://www.google.com/ via HTTP + NULL, 0, 1, LOWEST, HostPortPair("www.example.org", 443))); + // fetch https://www.example.org/ via HTTP - const char get[] = "GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"; + const char get[] = + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"; scoped_ptr<SpdyFrame> wrapped_get( spdy_util_.ConstructSpdyBodyFrame(1, get, strlen(get), false)); scoped_ptr<SpdyFrame> conn_resp( @@ -3635,7 +3665,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyConnectHttps) { TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyConnectSpdy) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); request.load_flags = 0; // Configure against https proxy server "proxy:70". @@ -3648,11 +3678,11 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyConnectSpdy) { scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); - // CONNECT to www.google.com:443 via SPDY + // CONNECT to www.example.org:443 via SPDY 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 kMyUrl[] = "https://www.google.com/"; + NULL, 0, 1, LOWEST, HostPortPair("www.example.org", 443))); + // fetch https://www.example.org/ via SPDY + const char kMyUrl[] = "https://www.example.org/"; scoped_ptr<SpdyFrame> get( spdy_util_.ConstructSpdyGet(kMyUrl, false, 1, LOWEST)); scoped_ptr<SpdyFrame> wrapped_get( @@ -3724,7 +3754,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyConnectSpdy) { TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyConnectFailure) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); request.load_flags = 0; // Configure against https proxy server "proxy:70". @@ -3737,9 +3767,9 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyConnectFailure) { scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); - // CONNECT to www.google.com:443 via SPDY + // CONNECT to www.example.org:443 via SPDY scoped_ptr<SpdyFrame> connect(spdy_util_.ConstructSpdyConnect( - NULL, 0, 1, LOWEST, HostPortPair("www.google.com", 443))); + NULL, 0, 1, LOWEST, HostPortPair("www.example.org", 443))); scoped_ptr<SpdyFrame> get( spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); @@ -3792,23 +3822,24 @@ TEST_P(HttpNetworkTransactionTest, HttpRequestInfo request1; request1.method = "GET"; - request1.url = GURL("https://www.google.com/"); + request1.url = GURL("https://www.example.org/"); request1.load_flags = 0; HttpRequestInfo request2; request2.method = "GET"; - request2.url = GURL("https://news.google.com/"); + request2.url = GURL("https://mail.example.org/"); request2.load_flags = 0; - // CONNECT to www.google.com:443 via SPDY. + // CONNECT to www.example.org:443 via SPDY. scoped_ptr<SpdyFrame> connect1(spdy_util_.ConstructSpdyConnect( - NULL, 0, 1, LOWEST, HostPortPair("www.google.com", 443))); + NULL, 0, 1, LOWEST, HostPortPair("www.example.org", 443))); scoped_ptr<SpdyFrame> conn_resp1( spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1)); - // Fetch https://www.google.com/ via HTTP. - const char get1[] = "GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" + // Fetch https://www.example.org/ via HTTP. + const char get1[] = + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" "Connection: keep-alive\r\n\r\n"; scoped_ptr<SpdyFrame> wrapped_get1( spdy_util_.ConstructSpdyBodyFrame(1, get1, strlen(get1), false)); @@ -3821,11 +3852,11 @@ TEST_P(HttpNetworkTransactionTest, scoped_ptr<SpdyFrame> window_update( spdy_util_.ConstructSpdyWindowUpdate(1, wrapped_get_resp1->size())); - // CONNECT to news.google.com:443 via SPDY. + // CONNECT to mail.example.org:443 via SPDY. SpdyHeaderBlock connect2_block; connect2_block[spdy_util_.GetMethodKey()] = "CONNECT"; - connect2_block[spdy_util_.GetPathKey()] = "news.google.com:443"; - connect2_block[spdy_util_.GetHostKey()] = "news.google.com"; + connect2_block[spdy_util_.GetPathKey()] = "mail.example.org:443"; + connect2_block[spdy_util_.GetHostKey()] = "mail.example.org"; spdy_util_.MaybeAddVersionHeader(&connect2_block); scoped_ptr<SpdyFrame> connect2( spdy_util_.ConstructSpdySyn(3, connect2_block, LOWEST, false, false)); @@ -3833,9 +3864,10 @@ TEST_P(HttpNetworkTransactionTest, scoped_ptr<SpdyFrame> conn_resp2( spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 3)); - // Fetch https://news.google.com/ via HTTP. - const char get2[] = "GET / HTTP/1.1\r\n" - "Host: news.google.com\r\n" + // Fetch https://mail.example.org/ via HTTP. + const char get2[] = + "GET / HTTP/1.1\r\n" + "Host: mail.example.org\r\n" "Connection: keep-alive\r\n\r\n"; scoped_ptr<SpdyFrame> wrapped_get2( spdy_util_.ConstructSpdyBodyFrame(3, get2, strlen(get2), false)); @@ -3942,23 +3974,24 @@ TEST_P(HttpNetworkTransactionTest, HttpRequestInfo request1; request1.method = "GET"; - request1.url = GURL("https://www.google.com/"); + request1.url = GURL("https://www.example.org/"); request1.load_flags = 0; HttpRequestInfo request2; request2.method = "GET"; - request2.url = GURL("https://www.google.com/2"); + request2.url = GURL("https://www.example.org/2"); request2.load_flags = 0; - // CONNECT to www.google.com:443 via SPDY. + // CONNECT to www.example.org:443 via SPDY. scoped_ptr<SpdyFrame> connect1(spdy_util_.ConstructSpdyConnect( - NULL, 0, 1, LOWEST, HostPortPair("www.google.com", 443))); + NULL, 0, 1, LOWEST, HostPortPair("www.example.org", 443))); scoped_ptr<SpdyFrame> conn_resp1( spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1)); - // Fetch https://www.google.com/ via HTTP. - const char get1[] = "GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" + // Fetch https://www.example.org/ via HTTP. + const char get1[] = + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" "Connection: keep-alive\r\n\r\n"; scoped_ptr<SpdyFrame> wrapped_get1( spdy_util_.ConstructSpdyBodyFrame(1, get1, strlen(get1), false)); @@ -3971,9 +4004,10 @@ TEST_P(HttpNetworkTransactionTest, scoped_ptr<SpdyFrame> window_update( spdy_util_.ConstructSpdyWindowUpdate(1, wrapped_get_resp1->size())); - // Fetch https://www.google.com/2 via HTTP. - const char get2[] = "GET /2 HTTP/1.1\r\n" - "Host: www.google.com\r\n" + // Fetch https://www.example.org/2 via HTTP. + const char get2[] = + "GET /2 HTTP/1.1\r\n" + "Host: www.example.org\r\n" "Connection: keep-alive\r\n\r\n"; scoped_ptr<SpdyFrame> wrapped_get2( spdy_util_.ConstructSpdyBodyFrame(1, get2, strlen(get2), false)); @@ -4073,17 +4107,17 @@ TEST_P(HttpNetworkTransactionTest, HttpRequestInfo request1; request1.method = "GET"; - request1.url = GURL("http://www.google.com/"); + request1.url = GURL("http://www.example.org/"); request1.load_flags = 0; HttpRequestInfo request2; request2.method = "GET"; - request2.url = GURL("http://news.google.com/"); + request2.url = GURL("http://mail.example.org/"); request2.load_flags = 0; - // http://www.google.com/ + // http://www.example.org/ scoped_ptr<SpdyHeaderBlock> headers( - spdy_util_.ConstructGetHeaderBlockForProxy("http://www.google.com/")); + spdy_util_.ConstructGetHeaderBlockForProxy("http://www.example.org/")); scoped_ptr<SpdyFrame> get1( spdy_util_.ConstructSpdySyn(1, *headers, LOWEST, false, true)); scoped_ptr<SpdyFrame> get_resp1( @@ -4091,9 +4125,9 @@ TEST_P(HttpNetworkTransactionTest, scoped_ptr<SpdyFrame> body1( spdy_util_.ConstructSpdyBodyFrame(1, "1", 1, true)); - // http://news.google.com/ + // http://mail.example.org/ scoped_ptr<SpdyHeaderBlock> headers2( - spdy_util_.ConstructGetHeaderBlockForProxy("http://news.google.com/")); + spdy_util_.ConstructGetHeaderBlockForProxy("http://mail.example.org/")); scoped_ptr<SpdyFrame> get2( spdy_util_.ConstructSpdySyn(3, *headers2, LOWEST, false, true)); scoped_ptr<SpdyFrame> get_resp2( @@ -4177,7 +4211,7 @@ TEST_P(HttpNetworkTransactionTest, TEST_P(HttpNetworkTransactionTest, HttpsProxyAuthRetry) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); // when the no authentication data flag is set. request.load_flags = net::LOAD_DO_NOT_SEND_AUTH_DATA; @@ -4190,16 +4224,18 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxyAuthRetry) { // Since we have proxy, should use full url MockWrite data_writes1[] = { - MockWrite("GET http://www.google.com/ HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET http://www.example.org/ HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n\r\n"), - // After calling trans->RestartWithAuth(), this is the request we should - // be issuing -- the final header line contains the credentials. - MockWrite("GET http://www.google.com/ HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n" - "Proxy-Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), + // After calling trans->RestartWithAuth(), this is the request we should + // be issuing -- the final header line contains the credentials. + MockWrite( + "GET http://www.example.org/ HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n" + "Proxy-Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), }; // The proxy responds to the GET with a 407, using a persistent @@ -4276,7 +4312,7 @@ void HttpNetworkTransactionTest::ConnectStatusHelperWithExpectedStatus( const MockRead& status, int expected_status) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); request.load_flags = 0; // Configure against proxy server "myproxy:70". @@ -4285,9 +4321,10 @@ void HttpNetworkTransactionTest::ConnectStatusHelperWithExpectedStatus( // Since we have proxy, should try to establish tunnel. MockWrite data_writes[] = { - MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n\r\n"), + MockWrite( + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n\r\n"), }; MockRead data_reads[] = { @@ -4493,7 +4530,7 @@ TEST_P(HttpNetworkTransactionTest, ConnectStatus505) { TEST_P(HttpNetworkTransactionTest, BasicAuthProxyThenServer) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; // Configure against proxy server "myproxy:70". @@ -4504,9 +4541,10 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyThenServer) { new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes1[] = { - MockWrite("GET http://www.google.com/ HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET http://www.example.org/ HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n\r\n"), }; MockRead data_reads1[] = { @@ -4526,10 +4564,11 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyThenServer) { // request we should be issuing -- the final header line contains the // proxy's credentials. MockWrite data_writes2[] = { - MockWrite("GET http://www.google.com/ HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n" - "Proxy-Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), + MockWrite( + "GET http://www.example.org/ HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n" + "Proxy-Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), }; // Now the proxy server lets the request pass through to origin server. @@ -4547,11 +4586,12 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyThenServer) { // After calling trans->RestartWithAuth() the second time, we should send // the credentials for both the proxy and origin server. MockWrite data_writes3[] = { - MockWrite("GET http://www.google.com/ HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n" - "Proxy-Authorization: Basic Zm9vOmJhcg==\r\n" - "Authorization: Basic Zm9vMjpiYXIy\r\n\r\n"), + MockWrite( + "GET http://www.example.org/ HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n" + "Proxy-Authorization: Basic Zm9vOmJhcg==\r\n" + "Authorization: Basic Zm9vMjpiYXIy\r\n\r\n"), }; // Lastly we get the desired content. @@ -4957,7 +4997,7 @@ TEST_P(HttpNetworkTransactionTest, NTLMAuth2) { TEST_P(HttpNetworkTransactionTest, LargeHeadersNoBody) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -4996,7 +5036,7 @@ TEST_P(HttpNetworkTransactionTest, DontRecycleTransportSocketForSSLTunnel) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); request.load_flags = 0; // Configure against proxy server "myproxy:70". @@ -5009,9 +5049,10 @@ TEST_P(HttpNetworkTransactionTest, // Since we have proxy, should try to establish tunnel. MockWrite data_writes1[] = { - MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n\r\n"), + MockWrite( + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n\r\n"), }; // The proxy responds to the connect with a 404, using a persistent @@ -5055,7 +5096,7 @@ TEST_P(HttpNetworkTransactionTest, TEST_P(HttpNetworkTransactionTest, RecycleSocket) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -5111,13 +5152,14 @@ TEST_P(HttpNetworkTransactionTest, RecycleSocket) { TEST_P(HttpNetworkTransactionTest, RecycleSSLSocket) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); request.load_flags = 0; MockWrite data_writes[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; MockRead data_reads[] = { @@ -5170,16 +5212,18 @@ TEST_P(HttpNetworkTransactionTest, RecycleSSLSocket) { TEST_P(HttpNetworkTransactionTest, RecycleDeadSSLSocket) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); request.load_flags = 0; MockWrite data_writes[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; MockRead data_reads[] = { @@ -5265,10 +5309,11 @@ TEST_P(HttpNetworkTransactionTest, RecycleDeadSSLSocket) { TEST_P(HttpNetworkTransactionTest, RecycleSocketAfterZeroContentLength) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/csi?v=3&s=web&action=&" - "tran=undefined&ei=mAXcSeegAo-SMurloeUN&" - "e=17259,18167,19592,19773,19981,20133,20173,20233&" - "rt=prt.2642,ol.2649,xjs.2951"); + request.url = GURL( + "http://www.example.org/csi?v=3&s=web&action=&" + "tran=undefined&ei=mAXcSeegAo-SMurloeUN&" + "e=17259,18167,19592,19773,19981,20133,20173,20233&" + "rt=prt.2642,ol.2649,xjs.2951"); request.load_flags = 0; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -5412,7 +5457,7 @@ TEST_P(HttpNetworkTransactionTest, ResendRequestOnWriteBodyError) { TEST_P(HttpNetworkTransactionTest, AuthIdentityInURL) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://foo:b@r@www.google.com/"); + request.url = GURL("http://foo:b@r@www.example.org/"); request.load_flags = LOAD_NORMAL; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -5424,9 +5469,10 @@ TEST_P(HttpNetworkTransactionTest, AuthIdentityInURL) { EXPECT_EQ("b%40r", request.url.password()); MockWrite data_writes1[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; MockRead data_reads1[] = { @@ -5439,10 +5485,11 @@ TEST_P(HttpNetworkTransactionTest, AuthIdentityInURL) { // After the challenge above, the transaction will be restarted using the // identity from the url (foo, b@r) to answer the challenge. MockWrite data_writes2[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Authorization: Basic Zm9vOmJAcg==\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Authorization: Basic Zm9vOmJAcg==\r\n\r\n"), }; MockRead data_reads2[] = { @@ -5492,7 +5539,7 @@ TEST_P(HttpNetworkTransactionTest, WrongAuthIdentityInURL) { request.method = "GET"; // Note: the URL has a username:password in it. The password "baz" is // wrong (should be "bar"). - request.url = GURL("http://foo:baz@www.google.com/"); + request.url = GURL("http://foo:baz@www.example.org/"); request.load_flags = LOAD_NORMAL; @@ -5501,9 +5548,10 @@ TEST_P(HttpNetworkTransactionTest, WrongAuthIdentityInURL) { new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes1[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; MockRead data_reads1[] = { @@ -5516,10 +5564,11 @@ TEST_P(HttpNetworkTransactionTest, WrongAuthIdentityInURL) { // After the challenge above, the transaction will be restarted using the // identity from the url (foo, baz) to answer the challenge. MockWrite data_writes2[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Authorization: Basic Zm9vOmJheg==\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Authorization: Basic Zm9vOmJheg==\r\n\r\n"), }; MockRead data_reads2[] = { @@ -5532,10 +5581,11 @@ TEST_P(HttpNetworkTransactionTest, WrongAuthIdentityInURL) { // After the challenge above, the transaction will be restarted using the // identity supplied by the user (foo, bar) to answer the challenge. MockWrite data_writes3[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), }; MockRead data_reads3[] = { @@ -5601,7 +5651,7 @@ TEST_P(HttpNetworkTransactionTest, WrongAuthIdentityInURL) { TEST_P(HttpNetworkTransactionTest, AuthIdentityInURLSuppressed) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://foo:bar@www.google.com/"); + request.url = GURL("http://foo:bar@www.example.org/"); request.load_flags = LOAD_DO_NOT_USE_EMBEDDED_IDENTITY; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -5609,9 +5659,10 @@ TEST_P(HttpNetworkTransactionTest, AuthIdentityInURLSuppressed) { new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes1[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; MockRead data_reads1[] = { @@ -5625,10 +5676,11 @@ TEST_P(HttpNetworkTransactionTest, AuthIdentityInURLSuppressed) { // identity supplied by the user, not the one in the URL, to answer the // challenge. MockWrite data_writes3[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), }; MockRead data_reads3[] = { @@ -5682,16 +5734,17 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/x/y/z"); + request.url = GURL("http://www.example.org/x/y/z"); request.load_flags = 0; scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes1[] = { - MockWrite("GET /x/y/z HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET /x/y/z HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; MockRead data_reads1[] = { @@ -5703,10 +5756,11 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { // Resend with authorization (username=foo, password=bar) MockWrite data_writes2[] = { - MockWrite("GET /x/y/z HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), + MockWrite( + "GET /x/y/z HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), }; // Sever accepts the authorization. @@ -5758,18 +5812,19 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { request.method = "GET"; // Note that Transaction 1 was at /x/y/z, so this is in the same // protection space as MyRealm1. - request.url = GURL("http://www.google.com/x/y/a/b"); + request.url = GURL("http://www.example.org/x/y/a/b"); request.load_flags = 0; scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes1[] = { - MockWrite("GET /x/y/a/b HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - // Send preemptive authorization for MyRealm1 - "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), + MockWrite( + "GET /x/y/a/b HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + // Send preemptive authorization for MyRealm1 + "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), }; // The server didn't like the preemptive authorization, and @@ -5783,10 +5838,11 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { // Resend with authorization for MyRealm2 (username=foo2, password=bar2) MockWrite data_writes2[] = { - MockWrite("GET /x/y/a/b HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Authorization: Basic Zm9vMjpiYXIy\r\n\r\n"), + MockWrite( + "GET /x/y/a/b HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Authorization: Basic Zm9vMjpiYXIy\r\n\r\n"), }; // Sever accepts the authorization. @@ -5815,7 +5871,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { ASSERT_TRUE(response != NULL); ASSERT_TRUE(response->auth_challenge.get()); EXPECT_FALSE(response->auth_challenge->is_proxy); - EXPECT_EQ("www.google.com:80", + EXPECT_EQ("www.example.org:80", response->auth_challenge->challenger.ToString()); EXPECT_EQ("MyRealm2", response->auth_challenge->realm); EXPECT_EQ("basic", response->auth_challenge->scheme); @@ -5842,19 +5898,20 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/x/y/z2"); + request.url = GURL("http://www.example.org/x/y/z2"); request.load_flags = 0; scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes1[] = { - MockWrite("GET /x/y/z2 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - // The authorization for MyRealm1 gets sent preemptively - // (since the url is in the same protection space) - "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), + MockWrite( + "GET /x/y/z2 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + // The authorization for MyRealm1 gets sent preemptively + // (since the url is in the same protection space) + "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), }; // Sever accepts the preemptive authorization @@ -5890,16 +5947,17 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/x/1"); + request.url = GURL("http://www.example.org/x/1"); request.load_flags = 0; scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes1[] = { - MockWrite("GET /x/1 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET /x/1 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; MockRead data_reads1[] = { @@ -5911,10 +5969,11 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { // Resend with authorization from MyRealm's cache. MockWrite data_writes2[] = { - MockWrite("GET /x/1 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), + MockWrite( + "GET /x/1 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), }; // Sever accepts the authorization. @@ -5960,16 +6019,17 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/p/q/t"); + request.url = GURL("http://www.example.org/p/q/t"); request.load_flags = 0; scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes1[] = { - MockWrite("GET /p/q/t HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET /p/q/t HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; MockRead data_reads1[] = { @@ -5981,10 +6041,11 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { // Resend with authorization from cache for MyRealm. MockWrite data_writes2[] = { - MockWrite("GET /p/q/t HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), + MockWrite( + "GET /p/q/t HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), }; // Sever rejects the authorization. @@ -5998,10 +6059,11 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { // At this point we should prompt for new credentials for MyRealm. // Restart with username=foo3, password=foo4. MockWrite data_writes3[] = { - MockWrite("GET /p/q/t HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Authorization: Basic Zm9vMzpiYXIz\r\n\r\n"), + MockWrite( + "GET /p/q/t HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Authorization: Basic Zm9vMzpiYXIz\r\n\r\n"), }; // Sever accepts the authorization. @@ -6072,16 +6134,17 @@ TEST_P(HttpNetworkTransactionTest, DigestPreAuthNonceCount) { { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/x/y/z"); + request.url = GURL("http://www.example.org/x/y/z"); request.load_flags = 0; scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes1[] = { - MockWrite("GET /x/y/z HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET /x/y/z HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; MockRead data_reads1[] = { @@ -6093,13 +6156,14 @@ TEST_P(HttpNetworkTransactionTest, DigestPreAuthNonceCount) { // Resend with authorization (username=foo, password=bar) MockWrite data_writes2[] = { - MockWrite("GET /x/y/z HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Authorization: Digest username=\"foo\", realm=\"digestive\", " - "nonce=\"OU812\", uri=\"/x/y/z\", algorithm=MD5, " - "response=\"03ffbcd30add722589c1de345d7a927f\", qop=auth, " - "nc=00000001, cnonce=\"0123456789abcdef\"\r\n\r\n"), + MockWrite( + "GET /x/y/z HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Authorization: Digest username=\"foo\", realm=\"digestive\", " + "nonce=\"OU812\", uri=\"/x/y/z\", algorithm=MD5, " + "response=\"03ffbcd30add722589c1de345d7a927f\", qop=auth, " + "nc=00000001, cnonce=\"0123456789abcdef\"\r\n\r\n"), }; // Sever accepts the authorization. @@ -6151,20 +6215,21 @@ TEST_P(HttpNetworkTransactionTest, DigestPreAuthNonceCount) { request.method = "GET"; // Note that Transaction 1 was at /x/y/z, so this is in the same // protection space as digest. - request.url = GURL("http://www.google.com/x/y/a/b"); + request.url = GURL("http://www.example.org/x/y/a/b"); request.load_flags = 0; scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes1[] = { - MockWrite("GET /x/y/a/b HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Authorization: Digest username=\"foo\", realm=\"digestive\", " - "nonce=\"OU812\", uri=\"/x/y/a/b\", algorithm=MD5, " - "response=\"d6f9a2c07d1c5df7b89379dca1269b35\", qop=auth, " - "nc=00000002, cnonce=\"0123456789abcdef\"\r\n\r\n"), + MockWrite( + "GET /x/y/a/b HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Authorization: Digest username=\"foo\", realm=\"digestive\", " + "nonce=\"OU812\", uri=\"/x/y/a/b\", algorithm=MD5, " + "response=\"d6f9a2c07d1c5df7b89379dca1269b35\", qop=auth, " + "nc=00000002, cnonce=\"0123456789abcdef\"\r\n\r\n"), }; // Sever accepts the authorization. @@ -6239,7 +6304,7 @@ TEST_P(HttpNetworkTransactionTest, ResetStateForRestart) { TEST_P(HttpNetworkTransactionTest, HTTPSBadCertificate) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); request.load_flags = 0; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -6247,9 +6312,10 @@ TEST_P(HttpNetworkTransactionTest, HTTPSBadCertificate) { new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; MockRead data_reads[] = { @@ -6297,13 +6363,14 @@ TEST_P(HttpNetworkTransactionTest, HTTPSBadCertificateViaProxy) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); request.load_flags = 0; MockWrite proxy_writes[] = { - MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n\r\n"), + MockWrite( + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n\r\n"), }; MockRead proxy_reads[] = { @@ -6312,12 +6379,14 @@ TEST_P(HttpNetworkTransactionTest, HTTPSBadCertificateViaProxy) { }; MockWrite data_writes[] = { - MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n\r\n"), - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; MockRead data_reads[] = { @@ -6379,16 +6448,18 @@ TEST_P(HttpNetworkTransactionTest, HTTPSViaHttpsProxy) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); request.load_flags = 0; MockWrite data_writes[] = { - MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n\r\n"), - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; MockRead data_reads[] = { @@ -6443,13 +6514,14 @@ TEST_P(HttpNetworkTransactionTest, RedirectOfHttpsConnectViaHttpsProxy) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); request.load_flags = 0; MockWrite data_writes[] = { - MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n\r\n"), + MockWrite( + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n\r\n"), }; MockRead data_reads[] = { @@ -6517,11 +6589,11 @@ TEST_P(HttpNetworkTransactionTest, RedirectOfHttpsConnectViaSpdyProxy) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); request.load_flags = 0; scoped_ptr<SpdyFrame> conn(spdy_util_.ConstructSpdyConnect( - NULL, 0, 1, LOWEST, HostPortPair("www.google.com", 443))); + NULL, 0, 1, LOWEST, HostPortPair("www.example.org", 443))); scoped_ptr<SpdyFrame> goaway( spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite data_writes[] = { @@ -6580,13 +6652,14 @@ TEST_P(HttpNetworkTransactionTest, HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); request.load_flags = 0; MockWrite data_writes[] = { - MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n\r\n"), + MockWrite( + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n\r\n"), }; MockRead data_reads[] = { @@ -6626,11 +6699,11 @@ TEST_P(HttpNetworkTransactionTest, HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); request.load_flags = 0; scoped_ptr<SpdyFrame> conn(spdy_util_.ConstructSpdyConnect( - NULL, 0, 1, LOWEST, HostPortPair("www.google.com", 443))); + NULL, 0, 1, LOWEST, HostPortPair("www.example.org", 443))); scoped_ptr<SpdyFrame> rst( spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite data_writes[] = { @@ -6684,7 +6757,7 @@ TEST_P(HttpNetworkTransactionTest, TEST_P(HttpNetworkTransactionTest, BasicAuthSpdyProxy) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); // when the no authentication data flag is set. request.load_flags = net::LOAD_DO_NOT_SEND_AUTH_DATA; @@ -6697,7 +6770,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthSpdyProxy) { // Since we have proxy, should try to establish tunnel. scoped_ptr<SpdyFrame> req(spdy_util_.ConstructSpdyConnect( - NULL, 0, 1, LOWEST, HostPortPair("www.google.com", 443))); + NULL, 0, 1, LOWEST, HostPortPair("www.example.org", 443))); scoped_ptr<SpdyFrame> rst( spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); @@ -6708,11 +6781,12 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthSpdyProxy) { }; scoped_ptr<SpdyFrame> connect2(spdy_util_.ConstructSpdyConnect( 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" - "Connection: keep-alive\r\n\r\n"; + HostPortPair("www.example.org", 443))); + // fetch https://www.example.org/ via HTTP + const char get[] = + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"; scoped_ptr<SpdyFrame> wrapped_get( spdy_util_.ConstructSpdyBodyFrame(3, get, strlen(get), false)); @@ -6825,7 +6899,7 @@ TEST_P(HttpNetworkTransactionTest, CrossOriginProxyPush) { HttpRequestInfo push_request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); push_request.method = "GET"; push_request.url = GURL("http://www.another-origin.com/foo.dat"); @@ -6942,7 +7016,7 @@ TEST_P(HttpNetworkTransactionTest, CrossOriginProxyPushCorrectness) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); // Configure against https proxy server "myproxy:70". session_deps_.proxy_service.reset( @@ -7028,14 +7102,15 @@ TEST_P(HttpNetworkTransactionTest, HTTPSBadCertificateViaHttpsProxy) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); request.load_flags = 0; // Attempt to fetch the URL from a server with a bad cert MockWrite bad_cert_writes[] = { - MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n\r\n"), + MockWrite( + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n\r\n"), }; MockRead bad_cert_reads[] = { @@ -7045,12 +7120,14 @@ TEST_P(HttpNetworkTransactionTest, HTTPSBadCertificateViaHttpsProxy) { // Attempt to fetch the URL with a good cert MockWrite good_data_writes[] = { - MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n\r\n"), - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; MockRead good_cert_reads[] = { @@ -7106,7 +7183,7 @@ TEST_P(HttpNetworkTransactionTest, HTTPSBadCertificateViaHttpsProxy) { TEST_P(HttpNetworkTransactionTest, BuildRequest_UserAgent) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.extra_headers.SetHeader(HttpRequestHeaders::kUserAgent, "Chromium Ultra Awesome X Edition"); @@ -7115,10 +7192,11 @@ TEST_P(HttpNetworkTransactionTest, BuildRequest_UserAgent) { new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "User-Agent: Chromium Ultra Awesome X Edition\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "User-Agent: Chromium Ultra Awesome X Edition\r\n\r\n"), }; // Lastly, the server responds with the actual content. @@ -7145,7 +7223,7 @@ TEST_P(HttpNetworkTransactionTest, BuildRequest_UserAgent) { TEST_P(HttpNetworkTransactionTest, BuildRequest_UserAgentOverTunnel) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); request.extra_headers.SetHeader(HttpRequestHeaders::kUserAgent, "Chromium Ultra Awesome X Edition"); @@ -7155,10 +7233,11 @@ TEST_P(HttpNetworkTransactionTest, BuildRequest_UserAgentOverTunnel) { new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes[] = { - MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n" - "User-Agent: Chromium Ultra Awesome X Edition\r\n\r\n"), + MockWrite( + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n" + "User-Agent: Chromium Ultra Awesome X Edition\r\n\r\n"), }; MockRead data_reads[] = { // Return an error, so the transaction stops here (this test isn't @@ -7184,7 +7263,7 @@ TEST_P(HttpNetworkTransactionTest, BuildRequest_UserAgentOverTunnel) { TEST_P(HttpNetworkTransactionTest, BuildRequest_Referer) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; request.extra_headers.SetHeader(HttpRequestHeaders::kReferer, "http://the.previous.site.com/"); @@ -7194,10 +7273,11 @@ TEST_P(HttpNetworkTransactionTest, BuildRequest_Referer) { new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Referer: http://the.previous.site.com/\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Referer: http://the.previous.site.com/\r\n\r\n"), }; // Lastly, the server responds with the actual content. @@ -7224,17 +7304,18 @@ TEST_P(HttpNetworkTransactionTest, BuildRequest_Referer) { TEST_P(HttpNetworkTransactionTest, BuildRequest_PostContentLengthZero) { HttpRequestInfo request; request.method = "POST"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes[] = { - MockWrite("POST / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Content-Length: 0\r\n\r\n"), + MockWrite( + "POST / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Content-Length: 0\r\n\r\n"), }; // Lastly, the server responds with the actual content. @@ -7261,17 +7342,18 @@ TEST_P(HttpNetworkTransactionTest, BuildRequest_PostContentLengthZero) { TEST_P(HttpNetworkTransactionTest, BuildRequest_PutContentLengthZero) { HttpRequestInfo request; request.method = "PUT"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes[] = { - MockWrite("PUT / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Content-Length: 0\r\n\r\n"), + MockWrite( + "PUT / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Content-Length: 0\r\n\r\n"), }; // Lastly, the server responds with the actual content. @@ -7298,17 +7380,18 @@ TEST_P(HttpNetworkTransactionTest, BuildRequest_PutContentLengthZero) { TEST_P(HttpNetworkTransactionTest, BuildRequest_HeadContentLengthZero) { HttpRequestInfo request; request.method = "HEAD"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes[] = { - MockWrite("HEAD / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Content-Length: 0\r\n\r\n"), + MockWrite( + "HEAD / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Content-Length: 0\r\n\r\n"), }; // Lastly, the server responds with the actual content. @@ -7335,7 +7418,7 @@ TEST_P(HttpNetworkTransactionTest, BuildRequest_HeadContentLengthZero) { TEST_P(HttpNetworkTransactionTest, BuildRequest_CacheControlNoCache) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = LOAD_BYPASS_CACHE; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -7343,11 +7426,12 @@ TEST_P(HttpNetworkTransactionTest, BuildRequest_CacheControlNoCache) { new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Pragma: no-cache\r\n" - "Cache-Control: no-cache\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Pragma: no-cache\r\n" + "Cache-Control: no-cache\r\n\r\n"), }; // Lastly, the server responds with the actual content. @@ -7375,7 +7459,7 @@ TEST_P(HttpNetworkTransactionTest, BuildRequest_CacheControlValidateCache) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = LOAD_VALIDATE_CACHE; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -7383,10 +7467,11 @@ TEST_P(HttpNetworkTransactionTest, new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Cache-Control: max-age=0\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Cache-Control: max-age=0\r\n\r\n"), }; // Lastly, the server responds with the actual content. @@ -7413,7 +7498,7 @@ TEST_P(HttpNetworkTransactionTest, TEST_P(HttpNetworkTransactionTest, BuildRequest_ExtraHeaders) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.extra_headers.SetHeader("FooHeader", "Bar"); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -7421,10 +7506,11 @@ TEST_P(HttpNetworkTransactionTest, BuildRequest_ExtraHeaders) { new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "FooHeader: Bar\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "FooHeader: Bar\r\n\r\n"), }; // Lastly, the server responds with the actual content. @@ -7451,7 +7537,7 @@ TEST_P(HttpNetworkTransactionTest, BuildRequest_ExtraHeaders) { TEST_P(HttpNetworkTransactionTest, BuildRequest_ExtraHeadersStripped) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.extra_headers.SetHeader("referer", "www.foo.com"); request.extra_headers.SetHeader("hEllo", "Kitty"); request.extra_headers.SetHeader("FoO", "bar"); @@ -7461,12 +7547,13 @@ TEST_P(HttpNetworkTransactionTest, BuildRequest_ExtraHeadersStripped) { new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "referer: www.foo.com\r\n" - "hEllo: Kitty\r\n" - "FoO: bar\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "referer: www.foo.com\r\n" + "hEllo: Kitty\r\n" + "FoO: bar\r\n\r\n"), }; // Lastly, the server responds with the actual content. @@ -7493,7 +7580,7 @@ TEST_P(HttpNetworkTransactionTest, BuildRequest_ExtraHeadersStripped) { TEST_P(HttpNetworkTransactionTest, SOCKS4_HTTP_GET) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; session_deps_.proxy_service.reset( @@ -7509,11 +7596,11 @@ TEST_P(HttpNetworkTransactionTest, SOCKS4_HTTP_GET) { char read_buffer[] = { 0x00, 0x5A, 0x00, 0x00, 0, 0, 0, 0 }; MockWrite data_writes[] = { - MockWrite(ASYNC, write_buffer, arraysize(write_buffer)), - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n") - }; + MockWrite(ASYNC, write_buffer, arraysize(write_buffer)), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n")}; MockRead data_reads[] = { MockRead(ASYNC, read_buffer, arraysize(read_buffer)), @@ -7552,7 +7639,7 @@ TEST_P(HttpNetworkTransactionTest, SOCKS4_HTTP_GET) { TEST_P(HttpNetworkTransactionTest, SOCKS4_SSL_GET) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); request.load_flags = 0; session_deps_.proxy_service.reset( @@ -7568,12 +7655,12 @@ TEST_P(HttpNetworkTransactionTest, SOCKS4_SSL_GET) { unsigned char read_buffer[] = { 0x00, 0x5A, 0x00, 0x00, 0, 0, 0, 0 }; MockWrite data_writes[] = { - MockWrite(ASYNC, reinterpret_cast<char*>(write_buffer), - arraysize(write_buffer)), - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n") - }; + MockWrite(ASYNC, reinterpret_cast<char*>(write_buffer), + arraysize(write_buffer)), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n")}; MockRead data_reads[] = { MockRead(ASYNC, reinterpret_cast<char*>(read_buffer), @@ -7616,7 +7703,7 @@ TEST_P(HttpNetworkTransactionTest, SOCKS4_SSL_GET) { TEST_P(HttpNetworkTransactionTest, SOCKS4_HTTP_GET_no_PAC) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; session_deps_.proxy_service.reset( @@ -7632,11 +7719,11 @@ TEST_P(HttpNetworkTransactionTest, SOCKS4_HTTP_GET_no_PAC) { char read_buffer[] = { 0x00, 0x5A, 0x00, 0x00, 0, 0, 0, 0 }; MockWrite data_writes[] = { - MockWrite(ASYNC, write_buffer, arraysize(write_buffer)), - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n") - }; + MockWrite(ASYNC, write_buffer, arraysize(write_buffer)), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n")}; MockRead data_reads[] = { MockRead(ASYNC, read_buffer, arraysize(read_buffer)), @@ -7675,7 +7762,7 @@ TEST_P(HttpNetworkTransactionTest, SOCKS4_HTTP_GET_no_PAC) { TEST_P(HttpNetworkTransactionTest, SOCKS5_HTTP_GET) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; session_deps_.proxy_service.reset( @@ -7690,25 +7777,24 @@ TEST_P(HttpNetworkTransactionTest, SOCKS5_HTTP_GET) { const char kSOCKS5GreetRequest[] = { 0x05, 0x01, 0x00 }; const char kSOCKS5GreetResponse[] = { 0x05, 0x00 }; const char kSOCKS5OkRequest[] = { - 0x05, // Version - 0x01, // Command (CONNECT) - 0x00, // Reserved. - 0x03, // Address type (DOMAINNAME). - 0x0E, // Length of domain (14) - // Domain string: - 'w', 'w', 'w', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'c', 'o', 'm', - 0x00, 0x50, // 16-bit port (80) + 0x05, // Version + 0x01, // Command (CONNECT) + 0x00, // Reserved. + 0x03, // Address type (DOMAINNAME). + 0x0F, // Length of domain (15) + 'w', 'w', 'w', '.', 'e', 'x', 'a', 'm', 'p', 'l', 'e', // Domain string + '.', 'o', 'r', 'g', 0x00, 0x50, // 16-bit port (80) }; const char kSOCKS5OkResponse[] = { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 }; MockWrite data_writes[] = { - MockWrite(ASYNC, kSOCKS5GreetRequest, arraysize(kSOCKS5GreetRequest)), - MockWrite(ASYNC, kSOCKS5OkRequest, arraysize(kSOCKS5OkRequest)), - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n") - }; + MockWrite(ASYNC, kSOCKS5GreetRequest, arraysize(kSOCKS5GreetRequest)), + MockWrite(ASYNC, kSOCKS5OkRequest, arraysize(kSOCKS5OkRequest)), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n")}; MockRead data_reads[] = { MockRead(ASYNC, kSOCKS5GreetResponse, arraysize(kSOCKS5GreetResponse)), @@ -7748,7 +7834,7 @@ TEST_P(HttpNetworkTransactionTest, SOCKS5_HTTP_GET) { TEST_P(HttpNetworkTransactionTest, SOCKS5_SSL_GET) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); request.load_flags = 0; session_deps_.proxy_service.reset( @@ -7763,27 +7849,26 @@ TEST_P(HttpNetworkTransactionTest, SOCKS5_SSL_GET) { const char kSOCKS5GreetRequest[] = { 0x05, 0x01, 0x00 }; const char kSOCKS5GreetResponse[] = { 0x05, 0x00 }; const unsigned char kSOCKS5OkRequest[] = { - 0x05, // Version - 0x01, // Command (CONNECT) - 0x00, // Reserved. - 0x03, // Address type (DOMAINNAME). - 0x0E, // Length of domain (14) - // Domain string: - 'w', 'w', 'w', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'c', 'o', 'm', - 0x01, 0xBB, // 16-bit port (443) + 0x05, // Version + 0x01, // Command (CONNECT) + 0x00, // Reserved. + 0x03, // Address type (DOMAINNAME). + 0x0F, // Length of domain (15) + 'w', 'w', 'w', '.', 'e', 'x', 'a', 'm', 'p', 'l', 'e', // Domain string + '.', 'o', 'r', 'g', 0x01, 0xBB, // 16-bit port (443) }; const char kSOCKS5OkResponse[] = { 0x05, 0x00, 0x00, 0x01, 0, 0, 0, 0, 0x00, 0x00 }; MockWrite data_writes[] = { - MockWrite(ASYNC, kSOCKS5GreetRequest, arraysize(kSOCKS5GreetRequest)), - MockWrite(ASYNC, reinterpret_cast<const char*>(kSOCKS5OkRequest), - arraysize(kSOCKS5OkRequest)), - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n") - }; + MockWrite(ASYNC, kSOCKS5GreetRequest, arraysize(kSOCKS5GreetRequest)), + MockWrite(ASYNC, reinterpret_cast<const char*>(kSOCKS5OkRequest), + arraysize(kSOCKS5OkRequest)), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n")}; MockRead data_reads[] = { MockRead(ASYNC, kSOCKS5GreetResponse, arraysize(kSOCKS5GreetResponse)), @@ -7870,38 +7955,38 @@ int GroupNameTransactionHelper( TEST_P(HttpNetworkTransactionTest, GroupNameForDirectConnections) { const GroupNameTest tests[] = { - { - "", // unused - "http://www.google.com/direct", - "www.google.com:80", - false, - }, - { - "", // unused - "http://[2001:1418:13:1::25]/direct", - "[2001:1418:13:1::25]:80", - false, - }, - - // SSL Tests - { - "", // unused - "https://www.google.com/direct_ssl", - "ssl/www.google.com:443", - true, - }, - { - "", // unused - "https://[2001:1418:13:1::25]/direct", - "ssl/[2001:1418:13:1::25]:443", - true, - }, - { - "", // unused - "http://host.with.alternate/direct", - "ssl/host.with.alternate:443", - true, - }, + { + "", // unused + "http://www.example.org/direct", + "www.example.org:80", + false, + }, + { + "", // unused + "http://[2001:1418:13:1::25]/direct", + "[2001:1418:13:1::25]:80", + false, + }, + + // SSL Tests + { + "", // unused + "https://www.example.org/direct_ssl", + "ssl/www.example.org:443", + true, + }, + { + "", // unused + "https://[2001:1418:13:1::25]/direct", + "ssl/[2001:1418:13:1::25]:443", + true, + }, + { + "", // unused + "http://host.with.alternate/direct", + "ssl/host.with.alternate:443", + true, + }, }; session_deps_.use_alternate_protocols = true; @@ -7937,34 +8022,34 @@ TEST_P(HttpNetworkTransactionTest, GroupNameForDirectConnections) { TEST_P(HttpNetworkTransactionTest, GroupNameForHTTPProxyConnections) { const GroupNameTest tests[] = { - { - "http_proxy", - "http://www.google.com/http_proxy_normal", - "www.google.com:80", - false, - }, - - // SSL Tests - { - "http_proxy", - "https://www.google.com/http_connect_ssl", - "ssl/www.google.com:443", - true, - }, - - { - "http_proxy", - "http://host.with.alternate/direct", - "ssl/host.with.alternate:443", - true, - }, - - { - "http_proxy", - "ftp://ftp.google.com/http_proxy_normal", - "ftp/ftp.google.com:21", - false, - }, + { + "http_proxy", + "http://www.example.org/http_proxy_normal", + "www.example.org:80", + false, + }, + + // SSL Tests + { + "http_proxy", + "https://www.example.org/http_connect_ssl", + "ssl/www.example.org:443", + true, + }, + + { + "http_proxy", + "http://host.with.alternate/direct", + "ssl/host.with.alternate:443", + true, + }, + + { + "http_proxy", + "ftp://ftp.google.com/http_proxy_normal", + "ftp/ftp.google.com:21", + false, + }, }; session_deps_.use_alternate_protocols = true; @@ -8002,39 +8087,39 @@ TEST_P(HttpNetworkTransactionTest, GroupNameForHTTPProxyConnections) { TEST_P(HttpNetworkTransactionTest, GroupNameForSOCKSConnections) { const GroupNameTest tests[] = { - { - "socks4://socks_proxy:1080", - "http://www.google.com/socks4_direct", - "socks4/www.google.com:80", - false, - }, - { - "socks5://socks_proxy:1080", - "http://www.google.com/socks5_direct", - "socks5/www.google.com:80", - false, - }, - - // SSL Tests - { - "socks4://socks_proxy:1080", - "https://www.google.com/socks4_ssl", - "socks4/ssl/www.google.com:443", - true, - }, - { - "socks5://socks_proxy:1080", - "https://www.google.com/socks5_ssl", - "socks5/ssl/www.google.com:443", - true, - }, - - { - "socks4://socks_proxy:1080", - "http://host.with.alternate/direct", - "socks4/ssl/host.with.alternate:443", - true, - }, + { + "socks4://socks_proxy:1080", + "http://www.example.org/socks4_direct", + "socks4/www.example.org:80", + false, + }, + { + "socks5://socks_proxy:1080", + "http://www.example.org/socks5_direct", + "socks5/www.example.org:80", + false, + }, + + // SSL Tests + { + "socks4://socks_proxy:1080", + "https://www.example.org/socks4_ssl", + "socks4/ssl/www.example.org:443", + true, + }, + { + "socks5://socks_proxy:1080", + "https://www.example.org/socks5_ssl", + "socks5/ssl/www.example.org:443", + true, + }, + + { + "socks4://socks_proxy:1080", + "http://host.with.alternate/direct", + "socks4/ssl/host.with.alternate:443", + true, + }, }; session_deps_.use_alternate_protocols = true; @@ -8076,7 +8161,7 @@ TEST_P(HttpNetworkTransactionTest, GroupNameForSOCKSConnections) { TEST_P(HttpNetworkTransactionTest, ReconsiderProxyAfterFailedConnection) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); session_deps_.proxy_service.reset( ProxyService::CreateFixed("myproxy:70;foobar:80")); @@ -8106,7 +8191,7 @@ void HttpNetworkTransactionTest::BypassHostCacheOnRefreshHelper( HttpRequestInfo request; request.method = "GET"; request.load_flags = load_flags; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); // Select a host resolver that does caching. session_deps_.host_resolver.reset(new MockCachingHostResolver); @@ -8115,16 +8200,12 @@ void HttpNetworkTransactionTest::BypassHostCacheOnRefreshHelper( scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); - // Warm up the host cache so it has an entry for "www.google.com". + // Warm up the host cache so it has an entry for "www.example.org". AddressList addrlist; TestCompletionCallback callback; int rv = session_deps_.host_resolver->Resolve( - HostResolver::RequestInfo(HostPortPair("www.google.com", 80)), - DEFAULT_PRIORITY, - &addrlist, - callback.callback(), - NULL, - BoundNetLog()); + HostResolver::RequestInfo(HostPortPair("www.example.org", 80)), + DEFAULT_PRIORITY, &addrlist, callback.callback(), NULL, BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); EXPECT_EQ(OK, rv); @@ -8132,18 +8213,14 @@ void HttpNetworkTransactionTest::BypassHostCacheOnRefreshHelper( // Verify that it was added to host cache, by doing a subsequent async lookup // and confirming it completes synchronously. rv = session_deps_.host_resolver->Resolve( - HostResolver::RequestInfo(HostPortPair("www.google.com", 80)), - DEFAULT_PRIORITY, - &addrlist, - callback.callback(), - NULL, - BoundNetLog()); + HostResolver::RequestInfo(HostPortPair("www.example.org", 80)), + DEFAULT_PRIORITY, &addrlist, callback.callback(), NULL, BoundNetLog()); ASSERT_EQ(OK, rv); - // Inject a failure the next time that "www.google.com" is resolved. This way + // Inject a failure the next time that "www.example.org" is resolved. This way // we can tell if the next lookup hit the cache, or the "network". // (cache --> success, "network" --> failure). - session_deps_.host_resolver->rules()->AddSimulatedFailure("www.google.com"); + session_deps_.host_resolver->rules()->AddSimulatedFailure("www.example.org"); // Connect up a mock socket which will fail with ERR_UNEXPECTED during the // first read -- this won't be reached as the host resolution will fail first. @@ -8157,7 +8234,7 @@ void HttpNetworkTransactionTest::BypassHostCacheOnRefreshHelper( rv = callback.WaitForResult(); // If we bypassed the cache, we would have gotten a failure while resolving - // "www.google.com". + // "www.example.org". EXPECT_EQ(ERR_NAME_NOT_RESOLVED, rv); } @@ -8246,13 +8323,14 @@ TEST_P(HttpNetworkTransactionTest, ConnectionClosedAfterStartOfHeaders) { TEST_P(HttpNetworkTransactionTest, DrainResetOK) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; MockWrite data_writes1[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; MockRead data_reads1[] = { @@ -8271,10 +8349,11 @@ TEST_P(HttpNetworkTransactionTest, DrainResetOK) { // After calling trans->RestartWithAuth(), this is the request we should // be issuing -- the final header line contains the credentials. MockWrite data_writes2[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), }; // Lastly, the server responds with the actual content. @@ -8326,7 +8405,7 @@ TEST_P(HttpNetworkTransactionTest, HTTPSViaProxyWithExtraData) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); request.load_flags = 0; MockRead proxy_reads[] = { @@ -8358,7 +8437,7 @@ TEST_P(HttpNetworkTransactionTest, HTTPSViaProxyWithExtraData) { TEST_P(HttpNetworkTransactionTest, LargeContentLengthThenClose) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -8409,7 +8488,7 @@ TEST_P(HttpNetworkTransactionTest, UploadFileSmallerThanLength) { HttpRequestInfo request; request.method = "POST"; - request.url = GURL("http://www.google.com/upload"); + request.url = GURL("http://www.example.org/upload"); request.upload_data_stream = &upload_data_stream; request.load_flags = 0; @@ -8466,7 +8545,7 @@ TEST_P(HttpNetworkTransactionTest, UploadUnreadableFile) { HttpRequestInfo request; request.method = "POST"; - request.url = GURL("http://www.google.com/upload"); + request.url = GURL("http://www.example.org/upload"); request.upload_data_stream = &upload_data_stream; request.load_flags = 0; @@ -8524,7 +8603,7 @@ TEST_P(HttpNetworkTransactionTest, CancelDuringInitRequestBody) { HttpRequestInfo request; request.method = "POST"; - request.url = GURL("http://www.google.com/upload"); + request.url = GURL("http://www.example.org/upload"); request.upload_data_stream = &upload_data_stream; request.load_flags = 0; @@ -8553,16 +8632,17 @@ TEST_P(HttpNetworkTransactionTest, ChangeAuthRealms) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; // First transaction will request a resource and receive a Basic challenge // with realm="first_realm". MockWrite data_writes1[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "\r\n"), }; MockRead data_reads1[] = { MockRead("HTTP/1.1 401 Unauthorized\r\n" @@ -8574,11 +8654,12 @@ TEST_P(HttpNetworkTransactionTest, ChangeAuthRealms) { // for first_realm. The server will reject and provide a challenge with // second_realm. MockWrite data_writes2[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Authorization: Basic Zmlyc3Q6YmF6\r\n" - "\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Authorization: Basic Zmlyc3Q6YmF6\r\n" + "\r\n"), }; MockRead data_reads2[] = { MockRead("HTTP/1.1 401 Unauthorized\r\n" @@ -8589,11 +8670,12 @@ TEST_P(HttpNetworkTransactionTest, ChangeAuthRealms) { // This again fails, and goes back to first_realm. Make sure that the // entry is removed from cache. MockWrite data_writes3[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Authorization: Basic c2Vjb25kOmZvdQ==\r\n" - "\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Authorization: Basic c2Vjb25kOmZvdQ==\r\n" + "\r\n"), }; MockRead data_reads3[] = { MockRead("HTTP/1.1 401 Unauthorized\r\n" @@ -8603,11 +8685,12 @@ TEST_P(HttpNetworkTransactionTest, ChangeAuthRealms) { // Try one last time (with the correct password) and get the resource. MockWrite data_writes4[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "Authorization: Basic Zmlyc3Q6YmFy\r\n" - "\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "Authorization: Basic Zmlyc3Q6YmFy\r\n" + "\r\n"), }; MockRead data_reads4[] = { MockRead("HTTP/1.1 200 OK\r\n" @@ -8648,7 +8731,7 @@ TEST_P(HttpNetworkTransactionTest, ChangeAuthRealms) { const AuthChallengeInfo* challenge = response->auth_challenge.get(); ASSERT_FALSE(challenge == NULL); EXPECT_FALSE(challenge->is_proxy); - EXPECT_EQ("www.google.com:80", challenge->challenger.ToString()); + EXPECT_EQ("www.example.org:80", challenge->challenger.ToString()); EXPECT_EQ("first_realm", challenge->realm); EXPECT_EQ("basic", challenge->scheme); @@ -8666,7 +8749,7 @@ TEST_P(HttpNetworkTransactionTest, ChangeAuthRealms) { challenge = response->auth_challenge.get(); ASSERT_FALSE(challenge == NULL); EXPECT_FALSE(challenge->is_proxy); - EXPECT_EQ("www.google.com:80", challenge->challenger.ToString()); + EXPECT_EQ("www.example.org:80", challenge->challenger.ToString()); EXPECT_EQ("second_realm", challenge->realm); EXPECT_EQ("basic", challenge->scheme); @@ -8685,7 +8768,7 @@ TEST_P(HttpNetworkTransactionTest, ChangeAuthRealms) { challenge = response->auth_challenge.get(); ASSERT_FALSE(challenge == NULL); EXPECT_FALSE(challenge->is_proxy); - EXPECT_EQ("www.google.com:80", challenge->challenger.ToString()); + EXPECT_EQ("www.example.org:80", challenge->challenger.ToString()); EXPECT_EQ("first_realm", challenge->realm); EXPECT_EQ("basic", challenge->scheme); @@ -8717,7 +8800,7 @@ TEST_P(HttpNetworkTransactionTest, HonorAlternateProtocolHeader) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; StaticSocketDataProvider data(data_reads, arraysize(data_reads), NULL, 0); @@ -8733,7 +8816,7 @@ TEST_P(HttpNetworkTransactionTest, HonorAlternateProtocolHeader) { int rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); - HostPortPair http_host_port_pair("www.google.com", 80); + HostPortPair http_host_port_pair("www.example.org", 80); HttpServerProperties& http_server_properties = *session->http_server_properties(); AlternativeService alternative_service = @@ -8773,7 +8856,7 @@ TEST_P(HttpNetworkTransactionTest, EmptyAlternateProtocolHeader) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; StaticSocketDataProvider data(data_reads, arraysize(data_reads), NULL, 0); @@ -8784,7 +8867,7 @@ TEST_P(HttpNetworkTransactionTest, EmptyAlternateProtocolHeader) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); - HostPortPair http_host_port_pair("www.google.com", 80); + HostPortPair http_host_port_pair("www.example.org", 80); HttpServerProperties& http_server_properties = *session->http_server_properties(); AlternativeService alternative_service(QUIC, "", 80); @@ -8825,7 +8908,7 @@ TEST_P(HttpNetworkTransactionTest, HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; MockConnect mock_connect(ASYNC, ERR_CONNECTION_REFUSED); @@ -8850,7 +8933,7 @@ TEST_P(HttpNetworkTransactionTest, // Port must be < 1024, or the header will be ignored (since initial port was // port 80 (another restricted port). AlternativeService alternative_service( - AlternateProtocolFromNextProto(GetParam()), "www.google.com", + AlternateProtocolFromNextProto(GetParam()), "www.example.org", 666); /* port is ignored by MockConnect anyway */ http_server_properties->SetAlternativeService(host_port_pair, alternative_service, 1.0); @@ -8889,7 +8972,7 @@ TEST_P(HttpNetworkTransactionTest, HttpRequestInfo restricted_port_request; restricted_port_request.method = "GET"; - restricted_port_request.url = GURL("http://www.google.com:1023/"); + restricted_port_request.url = GURL("http://www.example.org:1023/"); restricted_port_request.load_flags = 0; MockConnect mock_connect(ASYNC, ERR_CONNECTION_REFUSED); @@ -8912,7 +8995,7 @@ TEST_P(HttpNetworkTransactionTest, session->http_server_properties(); const int kUnrestrictedAlternatePort = 1024; AlternativeService alternative_service( - AlternateProtocolFromNextProto(GetParam()), "www.google.com", + AlternateProtocolFromNextProto(GetParam()), "www.example.org", kUnrestrictedAlternatePort); http_server_properties->SetAlternativeService( HostPortPair::FromURL(restricted_port_request.url), alternative_service, @@ -8942,7 +9025,7 @@ TEST_P(HttpNetworkTransactionTest, HttpRequestInfo restricted_port_request; restricted_port_request.method = "GET"; - restricted_port_request.url = GURL("http://www.google.com:1023/"); + restricted_port_request.url = GURL("http://www.example.org:1023/"); restricted_port_request.load_flags = 0; MockConnect mock_connect(ASYNC, ERR_CONNECTION_REFUSED); @@ -8965,7 +9048,7 @@ TEST_P(HttpNetworkTransactionTest, session->http_server_properties(); const int kUnrestrictedAlternatePort = 1024; AlternativeService alternative_service( - AlternateProtocolFromNextProto(GetParam()), "www.google.com", + AlternateProtocolFromNextProto(GetParam()), "www.example.org", kUnrestrictedAlternatePort); http_server_properties->SetAlternativeService( HostPortPair::FromURL(restricted_port_request.url), alternative_service, @@ -8992,7 +9075,7 @@ TEST_P(HttpNetworkTransactionTest, HttpRequestInfo restricted_port_request; restricted_port_request.method = "GET"; - restricted_port_request.url = GURL("http://www.google.com:1023/"); + restricted_port_request.url = GURL("http://www.example.org:1023/"); restricted_port_request.load_flags = 0; MockConnect mock_connect(ASYNC, ERR_CONNECTION_REFUSED); @@ -9015,7 +9098,7 @@ TEST_P(HttpNetworkTransactionTest, session->http_server_properties(); const int kRestrictedAlternatePort = 80; AlternativeService alternative_service( - AlternateProtocolFromNextProto(GetParam()), "www.google.com", + AlternateProtocolFromNextProto(GetParam()), "www.example.org", kRestrictedAlternatePort); http_server_properties->SetAlternativeService( HostPortPair::FromURL(restricted_port_request.url), alternative_service, @@ -9043,7 +9126,7 @@ TEST_P(HttpNetworkTransactionTest, HttpRequestInfo unrestricted_port_request; unrestricted_port_request.method = "GET"; - unrestricted_port_request.url = GURL("http://www.google.com:1024/"); + unrestricted_port_request.url = GURL("http://www.example.org:1024/"); unrestricted_port_request.load_flags = 0; MockConnect mock_connect(ASYNC, ERR_CONNECTION_REFUSED); @@ -9066,7 +9149,7 @@ TEST_P(HttpNetworkTransactionTest, session->http_server_properties(); const int kRestrictedAlternatePort = 80; AlternativeService alternative_service( - AlternateProtocolFromNextProto(GetParam()), "www.google.com", + AlternateProtocolFromNextProto(GetParam()), "www.example.org", kRestrictedAlternatePort); http_server_properties->SetAlternativeService( HostPortPair::FromURL(unrestricted_port_request.url), alternative_service, @@ -9093,7 +9176,7 @@ TEST_P(HttpNetworkTransactionTest, HttpRequestInfo unrestricted_port_request; unrestricted_port_request.method = "GET"; - unrestricted_port_request.url = GURL("http://www.google.com:1024/"); + unrestricted_port_request.url = GURL("http://www.example.org:1024/"); unrestricted_port_request.load_flags = 0; MockConnect mock_connect(ASYNC, ERR_CONNECTION_REFUSED); @@ -9116,7 +9199,7 @@ TEST_P(HttpNetworkTransactionTest, session->http_server_properties(); const int kUnrestrictedAlternatePort = 1024; AlternativeService alternative_service( - AlternateProtocolFromNextProto(GetParam()), "www.google.com", + AlternateProtocolFromNextProto(GetParam()), "www.example.org", kUnrestrictedAlternatePort); http_server_properties->SetAlternativeService( HostPortPair::FromURL(unrestricted_port_request.url), alternative_service, @@ -9141,7 +9224,7 @@ TEST_P(HttpNetworkTransactionTest, AlternateProtocolUnsafeBlocked) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; // The alternate protocol request will error out before we attempt to connect, @@ -9161,7 +9244,7 @@ TEST_P(HttpNetworkTransactionTest, AlternateProtocolUnsafeBlocked) { session->http_server_properties(); const int kUnsafePort = 7; AlternativeService alternative_service( - AlternateProtocolFromNextProto(GetParam()), "www.google.com", + AlternateProtocolFromNextProto(GetParam()), "www.example.org", kUnsafePort); http_server_properties->SetAlternativeService( HostPortPair::FromURL(request.url), alternative_service, 1.0); @@ -9194,7 +9277,7 @@ TEST_P(HttpNetworkTransactionTest, UseAlternateProtocolForNpnSpdy) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; std::string alternate_protocol_http_header = @@ -9214,6 +9297,8 @@ TEST_P(HttpNetworkTransactionTest, UseAlternateProtocolForNpnSpdy) { SSLSocketDataProvider ssl(ASYNC, OK); ssl.SetNextProto(GetParam()); + ssl.cert = ImportCertFromFile(GetTestCertsDirectory(), "spdy_pooling.pem"); + ASSERT_TRUE(ssl.cert.get()); session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl); scoped_ptr<SpdyFrame> req( @@ -9284,7 +9369,7 @@ TEST_P(HttpNetworkTransactionTest, AlternateProtocolWithSpdyLateBinding) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; std::string alternate_protocol_http_header = @@ -9314,6 +9399,8 @@ TEST_P(HttpNetworkTransactionTest, AlternateProtocolWithSpdyLateBinding) { SSLSocketDataProvider ssl(ASYNC, OK); ssl.SetNextProto(GetParam()); + ssl.cert = ImportCertFromFile(GetTestCertsDirectory(), "spdy_pooling.pem"); + ASSERT_TRUE(ssl.cert.get()); session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl); scoped_ptr<SpdyFrame> req1( @@ -9401,7 +9488,7 @@ TEST_P(HttpNetworkTransactionTest, StallAlternateProtocolForNpnSpdy) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; std::string alternate_protocol_http_header = @@ -9529,7 +9616,7 @@ TEST_P(HttpNetworkTransactionTest, HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; std::string alternate_protocol_http_header = @@ -9549,15 +9636,18 @@ TEST_P(HttpNetworkTransactionTest, SSLSocketDataProvider ssl(ASYNC, OK); ssl.SetNextProto(GetParam()); + ssl.cert = ImportCertFromFile(GetTestCertsDirectory(), "spdy_pooling.pem"); + ASSERT_TRUE(ssl.cert.get()); session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl); scoped_ptr<SpdyFrame> req( spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true)); MockWrite spdy_writes[] = { - MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n\r\n"), // 0 - CreateMockWrite(*req), // 3 + MockWrite( + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n\r\n"), // 0 + CreateMockWrite(*req), // 3 }; const char kCONNECTResponse[] = "HTTP/1.1 200 Connected\r\n\r\n"; @@ -9621,9 +9711,9 @@ TEST_P(HttpNetworkTransactionTest, ASSERT_EQ(OK, ReadTransaction(trans.get(), &response_data)); EXPECT_EQ("hello!", response_data); ASSERT_EQ(3u, capturing_proxy_resolver.resolved().size()); - EXPECT_EQ("http://www.google.com/", + EXPECT_EQ("http://www.example.org/", capturing_proxy_resolver.resolved()[0].spec()); - EXPECT_EQ("https://www.google.com/", + EXPECT_EQ("https://www.example.org/", capturing_proxy_resolver.resolved()[1].spec()); LoadTimingInfo load_timing_info; @@ -9639,7 +9729,7 @@ TEST_P(HttpNetworkTransactionTest, HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; std::string alternate_protocol_http_header = @@ -9658,6 +9748,8 @@ TEST_P(HttpNetworkTransactionTest, SSLSocketDataProvider ssl(ASYNC, OK); ssl.SetNextProto(GetParam()); + ssl.cert = ImportCertFromFile(GetTestCertsDirectory(), "spdy_pooling.pem"); + ASSERT_TRUE(ssl.cert.get()); session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl); scoped_ptr<SpdyFrame> req( @@ -9699,7 +9791,7 @@ TEST_P(HttpNetworkTransactionTest, EXPECT_EQ("hello world", response_data); // Set up an initial SpdySession in the pool to reuse. - HostPortPair host_port_pair("www.google.com", 443); + HostPortPair host_port_pair("www.example.org", 443); SpdySessionKey key(host_port_pair, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); base::WeakPtr<SpdySession> spdy_session = @@ -10329,13 +10421,14 @@ TEST_P(HttpNetworkTransactionTest, NpnWithHttpOverSSL) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); request.load_flags = 0; MockWrite data_writes[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; std::string alternate_protocol_http_header = @@ -10392,7 +10485,7 @@ TEST_P(HttpNetworkTransactionTest, SpdyPostNPNServerHangup) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); request.load_flags = 0; SSLSocketDataProvider ssl(ASYNC, OK); @@ -10470,15 +10563,16 @@ TEST_P(HttpNetworkTransactionTest, SpdyAlternateProtocolThroughProxy) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com"); + request.url = GURL("http://www.example.org"); request.load_flags = 0; // First round goes unauthenticated through the proxy. MockWrite data_writes_1[] = { - MockWrite("GET http://www.google.com/ HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n" - "\r\n"), + MockWrite( + "GET http://www.example.org/ HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n" + "\r\n"), }; MockRead data_reads_1[] = { MockRead(SYNCHRONOUS, ERR_TEST_PEER_CLOSE_AFTER_NEXT_MOCK_READ), @@ -10492,10 +10586,10 @@ TEST_P(HttpNetworkTransactionTest, SpdyAlternateProtocolThroughProxy) { StaticSocketDataProvider data_1(data_reads_1, arraysize(data_reads_1), data_writes_1, arraysize(data_writes_1)); - // Second round tries to tunnel to www.google.com due to the + // Second round tries to tunnel to www.example.org due to the // Alternate-Protocol announcement in the first round. It fails due // to a proxy authentication challenge. - // After the failure, a tunnel is established to www.google.com using + // After the failure, a tunnel is established to www.example.org using // Proxy-Authorization headers. There is then a SPDY request round. // // NOTE: Despite the "Proxy-Connection: Close", these are done on the @@ -10515,21 +10609,23 @@ TEST_P(HttpNetworkTransactionTest, SpdyAlternateProtocolThroughProxy) { scoped_ptr<SpdyFrame> data(spdy_util_.ConstructSpdyBodyFrame(1, true)); MockWrite data_writes_2[] = { - // First connection attempt without Proxy-Authorization. - MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n" - "\r\n"), - - // Second connection attempt with Proxy-Authorization. - MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n" - "Proxy-Authorization: auth_token\r\n" - "\r\n"), - - // SPDY request - CreateMockWrite(*req), + // First connection attempt without Proxy-Authorization. + MockWrite( + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n" + "\r\n"), + + // Second connection attempt with Proxy-Authorization. + MockWrite( + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n" + "Proxy-Authorization: auth_token\r\n" + "\r\n"), + + // SPDY request + CreateMockWrite(*req), }; const char kRejectConnectResponse[] = ("HTTP/1.1 407 Unauthorized\r\n" "Proxy-Authenticate: Mock\r\n" @@ -10557,6 +10653,8 @@ TEST_P(HttpNetworkTransactionTest, SpdyAlternateProtocolThroughProxy) { SSLSocketDataProvider ssl(ASYNC, OK); ssl.SetNextProto(GetParam()); + ssl.cert = ImportCertFromFile(GetTestCertsDirectory(), "spdy_pooling.pem"); + ASSERT_TRUE(ssl.cert.get()); MockConnect never_finishing_connect(SYNCHRONOUS, ERR_IO_PENDING); StaticSocketDataProvider hanging_non_alternate_protocol_socket( @@ -10600,7 +10698,7 @@ TEST_P(HttpNetworkTransactionTest, SpdyAlternateProtocolThroughProxy) { // After all that work, these two lines (or actually, just the scheme) are // what this test is all about. Make sure it happens correctly. EXPECT_EQ("https", request_url.scheme()); - EXPECT_EQ("www.google.com", request_url.host()); + EXPECT_EQ("www.example.org", request_url.host()); LoadTimingInfo load_timing_info; EXPECT_TRUE(trans_2->GetLoadTimingInfo(&load_timing_info)); @@ -10625,7 +10723,7 @@ TEST_P(HttpNetworkTransactionTest, SimpleCancel) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; session_deps_.host_resolver->set_synchronous_mode(true); @@ -10672,7 +10770,7 @@ TEST_P(HttpNetworkTransactionTest, CancelAfterHeaders) { { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; HttpNetworkTransaction trans(DEFAULT_PRIORITY, session.get()); @@ -10707,12 +10805,13 @@ TEST_P(HttpNetworkTransactionTest, ProxyGet) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); MockWrite data_writes1[] = { - MockWrite("GET http://www.google.com/ HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET http://www.example.org/ HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n\r\n"), }; MockRead data_reads1[] = { @@ -10770,17 +10869,19 @@ TEST_P(HttpNetworkTransactionTest, ProxyTunnelGet) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); // Since we have proxy, should try to establish tunnel. MockWrite data_writes1[] = { - MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n\r\n"), + MockWrite( + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n\r\n"), - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; MockRead data_reads1[] = { @@ -10845,17 +10946,19 @@ TEST_P(HttpNetworkTransactionTest, ProxyTunnelGetHangup) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); // Since we have proxy, should try to establish tunnel. MockWrite data_writes1[] = { - MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n\r\n"), + MockWrite( + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n\r\n"), - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; MockRead data_reads1[] = { @@ -10894,7 +10997,7 @@ TEST_P(HttpNetworkTransactionTest, ProxyTunnelGetHangup) { // Test for crbug.com/55424. TEST_P(HttpNetworkTransactionTest, PreconnectWithExistingSpdySession) { scoped_ptr<SpdyFrame> req( - spdy_util_.ConstructSpdyGet("https://www.google.com", false, 1, LOWEST)); + spdy_util_.ConstructSpdyGet("https://www.example.org", false, 1, LOWEST)); MockWrite spdy_writes[] = { CreateMockWrite(*req) }; scoped_ptr<SpdyFrame> resp(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1)); @@ -10918,7 +11021,7 @@ TEST_P(HttpNetworkTransactionTest, PreconnectWithExistingSpdySession) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); // Set up an initial SpdySession in the pool to reuse. - HostPortPair host_port_pair("www.google.com", 443); + HostPortPair host_port_pair("www.example.org", 443); SpdySessionKey key(host_port_pair, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); base::WeakPtr<SpdySession> spdy_session = @@ -10926,7 +11029,7 @@ TEST_P(HttpNetworkTransactionTest, PreconnectWithExistingSpdySession) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); request.load_flags = 0; // This is the important line that marks this as a preconnect. @@ -11346,7 +11449,7 @@ WRAPPED_TEST_P(HttpNetworkTransactionTest, MAYBE_UseIPConnectionPooling) { session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl); scoped_ptr<SpdyFrame> host1_req( - spdy_util_.ConstructSpdyGet("https://www.google.com", false, 1, LOWEST)); + spdy_util_.ConstructSpdyGet("https://www.example.org", false, 1, LOWEST)); scoped_ptr<SpdyFrame> host2_req( spdy_util_.ConstructSpdyGet("https://www.gmail.com", false, 3, LOWEST)); MockWrite spdy_writes[] = { @@ -11382,7 +11485,7 @@ WRAPPED_TEST_P(HttpNetworkTransactionTest, MAYBE_UseIPConnectionPooling) { TestCompletionCallback callback; HttpRequestInfo request1; request1.method = "GET"; - request1.url = GURL("https://www.google.com/"); + request1.url = GURL("https://www.example.org/"); request1.load_flags = 0; HttpNetworkTransaction trans1(DEFAULT_PRIORITY, session.get()); @@ -11449,7 +11552,7 @@ TEST_P(HttpNetworkTransactionTest, UseIPConnectionPoolingAfterResolution) { session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl); scoped_ptr<SpdyFrame> host1_req( - spdy_util_.ConstructSpdyGet("https://www.google.com", false, 1, LOWEST)); + spdy_util_.ConstructSpdyGet("https://www.example.org", false, 1, LOWEST)); scoped_ptr<SpdyFrame> host2_req( spdy_util_.ConstructSpdyGet("https://www.gmail.com", false, 3, LOWEST)); MockWrite spdy_writes[] = { @@ -11485,7 +11588,7 @@ TEST_P(HttpNetworkTransactionTest, UseIPConnectionPoolingAfterResolution) { TestCompletionCallback callback; HttpRequestInfo request1; request1.method = "GET"; - request1.url = GURL("https://www.google.com/"); + request1.url = GURL("https://www.example.org/"); request1.load_flags = 0; HttpNetworkTransaction trans1(DEFAULT_PRIORITY, session.get()); @@ -11595,7 +11698,7 @@ WRAPPED_TEST_P(HttpNetworkTransactionTest, session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl); scoped_ptr<SpdyFrame> host1_req( - spdy_util_.ConstructSpdyGet("https://www.google.com", false, 1, LOWEST)); + spdy_util_.ConstructSpdyGet("https://www.example.org", false, 1, LOWEST)); scoped_ptr<SpdyFrame> host2_req( spdy_util_.ConstructSpdyGet("https://www.gmail.com", false, 3, LOWEST)); MockWrite spdy_writes[] = { @@ -11631,7 +11734,7 @@ WRAPPED_TEST_P(HttpNetworkTransactionTest, TestCompletionCallback callback; HttpRequestInfo request1; request1.method = "GET"; - request1.url = GURL("https://www.google.com/"); + request1.url = GURL("https://www.example.org/"); request1.load_flags = 0; HttpNetworkTransaction trans1(DEFAULT_PRIORITY, session.get()); @@ -11684,8 +11787,8 @@ WRAPPED_TEST_P(HttpNetworkTransactionTest, #undef MAYBE_UseIPConnectionPoolingWithHostCacheExpiration TEST_P(HttpNetworkTransactionTest, DoNotUseSpdySessionForHttp) { - const std::string https_url = "https://www.google.com:8080/"; - const std::string http_url = "http://www.google.com:8080/"; + const std::string https_url = "https://www.example.org:8080/"; + const std::string http_url = "http://www.example.org:8080/"; // SPDY GET for HTTPS URL scoped_ptr<SpdyFrame> req1( @@ -11713,7 +11816,7 @@ TEST_P(HttpNetworkTransactionTest, DoNotUseSpdySessionForHttp) { MockWrite writes2[] = { MockWrite(ASYNC, 4, "GET / HTTP/1.1\r\n" - "Host: www.google.com:8080\r\n" + "Host: www.example.org:8080\r\n" "Connection: keep-alive\r\n\r\n"), }; @@ -11765,11 +11868,11 @@ TEST_P(HttpNetworkTransactionTest, DoNotUseSpdySessionForHttp) { } TEST_P(HttpNetworkTransactionTest, DoNotUseSpdySessionForHttpOverTunnel) { - const std::string https_url = "https://www.google.com:8080/"; - const std::string http_url = "http://www.google.com:8080/"; + const std::string https_url = "https://www.example.org:8080/"; + const std::string http_url = "http://www.example.org:8080/"; // SPDY GET for HTTPS URL (through CONNECT tunnel) - const HostPortPair host_port_pair("www.google.com", 8080); + const HostPortPair host_port_pair("www.example.org", 8080); scoped_ptr<SpdyFrame> connect( spdy_util_.ConstructSpdyConnect(NULL, 0, 1, LOWEST, host_port_pair)); scoped_ptr<SpdyFrame> req1( @@ -11781,7 +11884,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:8080"; + req2_block[spdy_util_.GetHostKey()] = "www.example.org:8080"; req2_block[spdy_util_.GetSchemeKey()] = "http"; spdy_util_.MaybeAddVersionHeader(&req2_block); scoped_ptr<SpdyFrame> req2( @@ -11881,13 +11984,13 @@ TEST_P(HttpNetworkTransactionTest, DoNotUseSpdySessionForHttpOverTunnel) { // the certificate does not match the new origin. // http://crbug.com/134690 TEST_P(HttpNetworkTransactionTest, DoNotUseSpdySessionIfCertDoesNotMatch) { - const std::string url1 = "http://www.google.com/"; - const std::string url2 = "https://mail.google.com/"; + const std::string url1 = "http://www.example.org/"; + const std::string url2 = "https://news.example.org/"; const std::string ip_addr = "1.2.3.4"; // SPDY GET for HTTP URL (through SPDY proxy) scoped_ptr<SpdyHeaderBlock> headers( - spdy_util_.ConstructGetHeaderBlockForProxy("http://www.google.com/")); + spdy_util_.ConstructGetHeaderBlockForProxy("http://www.example.org/")); scoped_ptr<SpdyFrame> req1( spdy_util_.ConstructSpdySyn(1, *headers, LOWEST, false, true)); @@ -11941,18 +12044,14 @@ TEST_P(HttpNetworkTransactionTest, DoNotUseSpdySessionIfCertDoesNotMatch) { session_deps_.proxy_service.reset(new ProxyService( new ProxyConfigServiceFixed(proxy_config), nullptr, NULL)); + SSLSocketDataProvider ssl1(ASYNC, OK); // to the proxy + ssl1.SetNextProto(GetParam()); // Load a valid cert. Note, that this does not need to // be valid for proxy because the MockSSLClientSocket does // not actually verify it. But SpdySession will use this // to see if it is valid for the new origin - base::FilePath certs_dir = GetTestCertsDirectory(); - scoped_refptr<X509Certificate> server_cert( - ImportCertFromFile(certs_dir, "ok_cert.pem")); - ASSERT_NE(static_cast<X509Certificate*>(NULL), server_cert.get()); - - SSLSocketDataProvider ssl1(ASYNC, OK); // to the proxy - ssl1.SetNextProto(GetParam()); - ssl1.cert = server_cert; + ssl1.cert = ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem"); + ASSERT_TRUE(ssl1.cert.get()); session_deps_.deterministic_socket_factory->AddSSLSocketDataProvider(&ssl1); session_deps_.deterministic_socket_factory->AddSocketDataProvider( data1.get()); @@ -11964,7 +12063,7 @@ TEST_P(HttpNetworkTransactionTest, DoNotUseSpdySessionIfCertDoesNotMatch) { data2.get()); session_deps_.host_resolver.reset(new MockCachingHostResolver()); - session_deps_.host_resolver->rules()->AddRule("mail.google.com", ip_addr); + session_deps_.host_resolver->rules()->AddRule("news.example.org", ip_addr); session_deps_.host_resolver->rules()->AddRule("proxy", ip_addr); scoped_refptr<HttpNetworkSession> session( @@ -12007,7 +12106,7 @@ TEST_P(HttpNetworkTransactionTest, DoNotUseSpdySessionIfCertDoesNotMatch) { // session. Verify that new url's from the same HttpNetworkSession (and a new // SpdySession) do work. http://crbug.com/224701 TEST_P(HttpNetworkTransactionTest, ErrorSocketNotConnected) { - const std::string https_url = "https://www.google.com/"; + const std::string https_url = "https://www.example.org/"; MockRead reads1[] = { MockRead(SYNCHRONOUS, ERR_CONNECTION_CLOSED, 0) @@ -12249,7 +12348,7 @@ TEST_P(HttpNetworkTransactionTest, CloseIdleSpdySessionToOpenNewOne) { TEST_P(HttpNetworkTransactionTest, HttpSyncConnectError) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -12279,7 +12378,7 @@ TEST_P(HttpNetworkTransactionTest, HttpSyncConnectError) { TEST_P(HttpNetworkTransactionTest, HttpAsyncConnectError) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -12309,7 +12408,7 @@ TEST_P(HttpNetworkTransactionTest, HttpAsyncConnectError) { TEST_P(HttpNetworkTransactionTest, HttpSyncWriteError) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -12345,7 +12444,7 @@ TEST_P(HttpNetworkTransactionTest, HttpSyncWriteError) { TEST_P(HttpNetworkTransactionTest, HttpAsyncWriteError) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -12381,7 +12480,7 @@ TEST_P(HttpNetworkTransactionTest, HttpAsyncWriteError) { TEST_P(HttpNetworkTransactionTest, HttpSyncReadError) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -12389,9 +12488,10 @@ TEST_P(HttpNetworkTransactionTest, HttpSyncReadError) { new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; MockRead data_reads[] = { MockRead(SYNCHRONOUS, ERR_CONNECTION_RESET), @@ -12419,7 +12519,7 @@ TEST_P(HttpNetworkTransactionTest, HttpSyncReadError) { TEST_P(HttpNetworkTransactionTest, HttpAsyncReadError) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -12427,9 +12527,10 @@ TEST_P(HttpNetworkTransactionTest, HttpAsyncReadError) { new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; MockRead data_reads[] = { MockRead(ASYNC, ERR_CONNECTION_RESET), @@ -12457,7 +12558,7 @@ TEST_P(HttpNetworkTransactionTest, HttpAsyncReadError) { TEST_P(HttpNetworkTransactionTest, GetFullRequestHeadersIncludesExtraHeader) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.load_flags = 0; request.extra_headers.SetHeader("X-Foo", "bar"); @@ -12466,10 +12567,11 @@ TEST_P(HttpNetworkTransactionTest, GetFullRequestHeadersIncludesExtraHeader) { new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n" - "X-Foo: bar\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n" + "X-Foo: bar\r\n\r\n"), }; MockRead data_reads[] = { MockRead("HTTP/1.1 200 OK\r\n" @@ -12929,7 +13031,8 @@ TEST_P(HttpNetworkTransactionTest, CreateWebSocketHandshakeStream) { // The same logic needs to be tested for both ws: and wss: schemes, but this // test is already parameterised on NextProto, so it uses a loop to verify // that the different schemes work. - std::string test_cases[] = {"ws://www.google.com/", "wss://www.google.com/"}; + std::string test_cases[] = {"ws://www.example.org/", + "wss://www.example.org/"}; for (size_t i = 0; i < arraysize(test_cases); ++i) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); HttpNetworkSessionPeer peer(session); @@ -12970,12 +13073,13 @@ TEST_P(HttpNetworkTransactionTest, CloseSSLSocketOnIdleForHttpRequest) { HttpRequestInfo ssl_request; ssl_request.method = "GET"; - ssl_request.url = GURL("https://www.google.com/"); + ssl_request.url = GURL("https://www.example.org/"); MockWrite ssl_writes[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; MockRead ssl_reads[] = { MockRead("HTTP/1.1 200 OK\r\n"), @@ -12994,12 +13098,13 @@ TEST_P(HttpNetworkTransactionTest, CloseSSLSocketOnIdleForHttpRequest) { HttpRequestInfo http_request; http_request.method = "GET"; - http_request.url = GURL("http://www.google.com/"); + http_request.url = GURL("http://www.example.org/"); MockWrite http_writes[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; MockRead http_reads[] = { MockRead("HTTP/1.1 200 OK\r\n"), @@ -13075,12 +13180,13 @@ TEST_P(HttpNetworkTransactionTest, CloseSSLSocketOnIdleForHttpRequest2) { HttpRequestInfo http_request; http_request.method = "GET"; - http_request.url = GURL("http://www.google.com/"); + http_request.url = GURL("http://www.example.org/"); MockWrite http_writes[] = { - MockWrite("GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Connection: keep-alive\r\n\r\n"), + MockWrite( + "GET / HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Connection: keep-alive\r\n\r\n"), }; MockRead http_reads[] = { MockRead("HTTP/1.1 200 OK\r\n"), @@ -13610,7 +13716,7 @@ TEST_P(HttpNetworkTransactionTest, PostIgnoresPartial400HeadersAfterReset) { TEST_P(HttpNetworkTransactionTest, ProxyHeadersNotSentOverWssTunnel) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("wss://www.google.com/"); + request.url = GURL("wss://www.example.org/"); AddWebSocketHeaders(&request.extra_headers); // Configure against proxy server "myproxy:70". @@ -13622,24 +13728,24 @@ TEST_P(HttpNetworkTransactionTest, ProxyHeadersNotSentOverWssTunnel) { // Since a proxy is configured, try to establish a tunnel. MockWrite data_writes[] = { MockWrite( - "CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" "Proxy-Connection: keep-alive\r\n\r\n"), // After calling trans->RestartWithAuth(), this is the request we should // be issuing -- the final header line contains the credentials. MockWrite( - "CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" "Proxy-Connection: keep-alive\r\n" "Proxy-Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), MockWrite( "GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" + "Host: www.example.org\r\n" "Connection: Upgrade\r\n" "Upgrade: websocket\r\n" - "Origin: http://www.google.com\r\n" + "Origin: http://www.example.org\r\n" "Sec-WebSocket-Version: 13\r\n" "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\n\r\n"), }; @@ -13716,7 +13822,7 @@ TEST_P(HttpNetworkTransactionTest, ProxyHeadersNotSentOverWssTunnel) { TEST_P(HttpNetworkTransactionTest, ProxyHeadersNotSentOverWsTunnel) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("ws://www.google.com/"); + request.url = GURL("ws://www.example.org/"); AddWebSocketHeaders(&request.extra_headers); // Configure against proxy server "myproxy:70". @@ -13731,17 +13837,17 @@ TEST_P(HttpNetworkTransactionTest, ProxyHeadersNotSentOverWsTunnel) { // they cannot and will not use the same TCP/IP connection as the // preflight HTTP request. MockWrite( - "CONNECT www.google.com:80 HTTP/1.1\r\n" - "Host: www.google.com:80\r\n" + "CONNECT www.example.org:80 HTTP/1.1\r\n" + "Host: www.example.org:80\r\n" "Proxy-Connection: keep-alive\r\n" "Proxy-Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), MockWrite( "GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" + "Host: www.example.org\r\n" "Connection: Upgrade\r\n" "Upgrade: websocket\r\n" - "Origin: http://www.google.com\r\n" + "Origin: http://www.example.org\r\n" "Sec-WebSocket-Version: 13\r\n" "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\n\r\n"), }; diff --git a/net/spdy/spdy_http_stream_unittest.cc b/net/spdy/spdy_http_stream_unittest.cc index 55f5b36..6fecf45 100644 --- a/net/spdy/spdy_http_stream_unittest.cc +++ b/net/spdy/spdy_http_stream_unittest.cc @@ -126,7 +126,7 @@ TEST_P(SpdyHttpStreamTest, GetUploadProgressBeforeInitialization) { MockRead(ASYNC, 0, 0) // EOF }; - HostPortPair host_port_pair("www.google.com", 80); + HostPortPair host_port_pair("www.example.org", 80); SpdySessionKey key(host_port_pair, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); InitSession(reads, arraysize(reads), NULL, 0, key); @@ -151,14 +151,14 @@ TEST_P(SpdyHttpStreamTest, SendRequest) { CreateMockRead(*resp, 1), MockRead(SYNCHRONOUS, 0, 2) // EOF }; - HostPortPair host_port_pair("www.google.com", 80); + HostPortPair host_port_pair("www.example.org", 80); SpdySessionKey key(host_port_pair, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); InitSession(reads, arraysize(reads), writes, arraysize(writes), key); HttpRequestInfo request; request.method = "GET"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); TestCompletionCallback callback; HttpResponseInfo response; HttpRequestHeaders headers; @@ -224,14 +224,14 @@ TEST_P(SpdyHttpStreamTest, LoadTimingTwoRequests) { MockRead(ASYNC, 0, 6) // EOF }; - HostPortPair host_port_pair("www.google.com", 80); + HostPortPair host_port_pair("www.example.org", 80); SpdySessionKey key(host_port_pair, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); InitSession(reads, arraysize(reads), writes, arraysize(writes), key); HttpRequestInfo request1; request1.method = "GET"; - request1.url = GURL("http://www.google.com/"); + request1.url = GURL("http://www.example.org/"); TestCompletionCallback callback1; HttpResponseInfo response1; HttpRequestHeaders headers1; @@ -239,7 +239,7 @@ TEST_P(SpdyHttpStreamTest, LoadTimingTwoRequests) { HttpRequestInfo request2; request2.method = "GET"; - request2.url = GURL("http://www.google.com/"); + request2.url = GURL("http://www.example.org/"); TestCompletionCallback callback2; HttpResponseInfo response2; HttpRequestHeaders headers2; @@ -311,7 +311,7 @@ TEST_P(SpdyHttpStreamTest, SendChunkedPost) { reads.push_back(CreateMockRead(*body, seq++)); reads.push_back(MockRead(SYNCHRONOUS, 0, seq++)); // EOF - HostPortPair host_port_pair("www.google.com", 80); + HostPortPair host_port_pair("www.example.org", 80); SpdySessionKey key(host_port_pair, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); InitSession(vector_as_array(&reads), reads.size(), vector_as_array(&writes), @@ -326,7 +326,7 @@ TEST_P(SpdyHttpStreamTest, SendChunkedPost) { HttpRequestInfo request; request.method = "POST"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.upload_data_stream = &upload_stream; ASSERT_EQ(OK, upload_stream.Init(TestCompletionCallback().callback())); @@ -381,7 +381,7 @@ TEST_P(SpdyHttpStreamTest, DelayedSendChunkedPost) { MockRead(ASYNC, 0, 8) // EOF }; - HostPortPair host_port_pair("www.google.com", 80); + HostPortPair host_port_pair("www.example.org", 80); SpdySessionKey key(host_port_pair, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); InitSession(reads, arraysize(reads), writes, arraysize(writes), key); @@ -390,7 +390,7 @@ TEST_P(SpdyHttpStreamTest, DelayedSendChunkedPost) { HttpRequestInfo request; request.method = "POST"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.upload_data_stream = &upload_stream; ASSERT_EQ(OK, upload_stream.Init(TestCompletionCallback().callback())); @@ -478,7 +478,7 @@ TEST_P(SpdyHttpStreamTest, DelayedSendChunkedPostWithEmptyFinalDataFrame) { MockRead(ASYNC, 0, 6) // EOF }; - HostPortPair host_port_pair("www.google.com", 80); + HostPortPair host_port_pair("www.example.org", 80); SpdySessionKey key(host_port_pair, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); InitSession(reads, arraysize(reads), writes, arraysize(writes), key); @@ -487,7 +487,7 @@ TEST_P(SpdyHttpStreamTest, DelayedSendChunkedPostWithEmptyFinalDataFrame) { HttpRequestInfo request; request.method = "POST"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.upload_data_stream = &upload_stream; ASSERT_EQ(OK, upload_stream.Init(TestCompletionCallback().callback())); @@ -561,7 +561,7 @@ TEST_P(SpdyHttpStreamTest, ChunkedPostWithEmptyPayload) { MockRead(ASYNC, 0, 4) // EOF }; - HostPortPair host_port_pair("www.google.com", 80); + HostPortPair host_port_pair("www.example.org", 80); SpdySessionKey key(host_port_pair, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); InitSession(reads, arraysize(reads), writes, arraysize(writes), key); @@ -570,7 +570,7 @@ TEST_P(SpdyHttpStreamTest, ChunkedPostWithEmptyPayload) { HttpRequestInfo request; request.method = "POST"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.upload_data_stream = &upload_stream; ASSERT_EQ(OK, upload_stream.Init(TestCompletionCallback().callback())); @@ -616,8 +616,8 @@ TEST_P(SpdyHttpStreamTest, ChunkedPostWithEmptyPayload) { // Test case for bug: http://code.google.com/p/chromium/issues/detail?id=50058 TEST_P(SpdyHttpStreamTest, SpdyURLTest) { - const char * const full_url = "http://www.google.com/foo?query=what#anchor"; - const char * const base_url = "http://www.google.com/foo?query=what"; + const char* const full_url = "http://www.example.org/foo?query=what#anchor"; + const char* const base_url = "http://www.example.org/foo?query=what"; scoped_ptr<SpdyFrame> req( spdy_util_.ConstructSpdyGet(base_url, false, 1, LOWEST)); MockWrite writes[] = { @@ -628,7 +628,7 @@ TEST_P(SpdyHttpStreamTest, SpdyURLTest) { CreateMockRead(*resp, 1), MockRead(SYNCHRONOUS, 0, 2) // EOF }; - HostPortPair host_port_pair("www.google.com", 80); + HostPortPair host_port_pair("www.example.org", 80); SpdySessionKey key(host_port_pair, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); InitSession(reads, arraysize(reads), writes, arraysize(writes), key); @@ -681,7 +681,7 @@ TEST_P(SpdyHttpStreamTest, DelayedSendChunkedPostWithWindowUpdate) { MockRead(ASYNC, 0, 5) // EOF }; - HostPortPair host_port_pair("www.google.com", 80); + HostPortPair host_port_pair("www.example.org", 80); SpdySessionKey key(host_port_pair, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); @@ -691,7 +691,7 @@ TEST_P(SpdyHttpStreamTest, DelayedSendChunkedPostWithWindowUpdate) { HttpRequestInfo request; request.method = "POST"; - request.url = GURL("http://www.google.com/"); + request.url = GURL("http://www.example.org/"); request.upload_data_stream = &upload_stream; ASSERT_EQ(OK, upload_stream.Init(TestCompletionCallback().callback())); diff --git a/net/spdy/spdy_network_transaction_unittest.cc b/net/spdy/spdy_network_transaction_unittest.cc index e8d8e0b..aad489b 100644 --- a/net/spdy/spdy_network_transaction_unittest.cc +++ b/net/spdy/spdy_network_transaction_unittest.cc @@ -18,6 +18,7 @@ #include "net/base/chunked_upload_data_stream.h" #include "net/base/elements_upload_data_stream.h" #include "net/base/request_priority.h" +#include "net/base/test_data_directory.h" #include "net/base/upload_bytes_element_reader.h" #include "net/base/upload_file_element_reader.h" #include "net/http/http_network_session_peer.h" @@ -35,6 +36,7 @@ #include "net/spdy/spdy_test_util_common.h" #include "net/spdy/spdy_test_utils.h" #include "net/ssl/ssl_connection_status_flags.h" +#include "net/test/cert_test_util.h" #include "net/url_request/url_request_test_util.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/platform_test.h" @@ -92,9 +94,9 @@ void UpdateSpdySessionDependencies(SpdyNetworkTransactionTestParams test_params, session_deps->next_protos = SpdyNextProtos(); if (test_params.ssl_type == HTTP_SPDY_VIA_ALT_SVC) { session_deps->http_server_properties.SetAlternativeService( - HostPortPair("www.google.com", 80), + HostPortPair("www.example.org", 80), AlternativeService(AlternateProtocolFromNextProto(test_params.protocol), - "www.google.com", 443), + "www.example.org", 443), 1); } } @@ -133,9 +135,9 @@ class SpdyNetworkTransactionTest } void SetUp() override { - google_get_request_initialized_ = false; - google_post_request_initialized_ = false; - google_chunked_post_request_initialized_ = false; + get_request_initialized_ = false; + post_request_initialized_ = false; + chunked_post_request_initialized_ = false; ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); } @@ -313,6 +315,8 @@ class SpdyNetworkTransactionTest void AddData(StaticSocketDataProvider* data) { scoped_ptr<SSLSocketDataProvider> ssl_provider( new SSLSocketDataProvider(ASYNC, OK)); + ssl_provider->cert = + ImportCertFromFile(GetTestCertsDirectory(), "spdy_pooling.pem"); AddDataWithSSLSocketDataProvider(data, ssl_provider.Pass()); } @@ -348,6 +352,8 @@ class SpdyNetworkTransactionTest SSLSocketDataProvider* ssl_provider = new SSLSocketDataProvider(ASYNC, OK); ssl_provider->SetNextProto(test_params_.protocol); + ssl_provider->cert = + ImportCertFromFile(GetTestCertsDirectory(), "spdy_pooling.pem"); ssl_vector_.push_back(ssl_provider); session_deps_->deterministic_socket_factory->AddSSLSocketDataProvider( ssl_provider); @@ -413,51 +419,51 @@ class SpdyNetworkTransactionTest void ConnectStatusHelper(const MockRead& status); const HttpRequestInfo& CreateGetPushRequest() { - google_get_push_request_.method = "GET"; - google_get_push_request_.url = GURL(GetDefaultUrlWithPath("/foo.dat")); - google_get_push_request_.load_flags = 0; - return google_get_push_request_; + get_push_request_.method = "GET"; + get_push_request_.url = GURL(GetDefaultUrlWithPath("/foo.dat")); + get_push_request_.load_flags = 0; + return get_push_request_; } const HttpRequestInfo& CreateGetRequest() { - if (!google_get_request_initialized_) { - google_get_request_.method = "GET"; - google_get_request_.url = GURL(GetDefaultUrl()); - google_get_request_.load_flags = 0; - google_get_request_initialized_ = true; + if (!get_request_initialized_) { + get_request_.method = "GET"; + get_request_.url = GURL(GetDefaultUrl()); + get_request_.load_flags = 0; + get_request_initialized_ = true; } - return google_get_request_; + return get_request_; } const HttpRequestInfo& CreateGetRequestWithUserAgent() { - if (!google_get_request_initialized_) { - google_get_request_.method = "GET"; - google_get_request_.url = GURL(GetDefaultUrl()); - google_get_request_.load_flags = 0; - google_get_request_.extra_headers.SetHeader("User-Agent", "Chrome"); - google_get_request_initialized_ = true; + if (!get_request_initialized_) { + get_request_.method = "GET"; + get_request_.url = GURL(GetDefaultUrl()); + get_request_.load_flags = 0; + get_request_.extra_headers.SetHeader("User-Agent", "Chrome"); + get_request_initialized_ = true; } - return google_get_request_; + return get_request_; } const HttpRequestInfo& CreatePostRequest() { - if (!google_post_request_initialized_) { + if (!post_request_initialized_) { ScopedVector<UploadElementReader> element_readers; element_readers.push_back( new UploadBytesElementReader(kUploadData, kUploadDataSize)); upload_data_stream_.reset( new ElementsUploadDataStream(element_readers.Pass(), 0)); - google_post_request_.method = "POST"; - google_post_request_.url = GURL(GetDefaultUrl()); - google_post_request_.upload_data_stream = upload_data_stream_.get(); - google_post_request_initialized_ = true; + post_request_.method = "POST"; + post_request_.url = GURL(GetDefaultUrl()); + post_request_.upload_data_stream = upload_data_stream_.get(); + post_request_initialized_ = true; } - return google_post_request_; + return post_request_; } const HttpRequestInfo& CreateFilePostRequest() { - if (!google_post_request_initialized_) { + if (!post_request_initialized_) { base::FilePath file_path; CHECK(base::CreateTemporaryFileInDir(temp_dir_.path(), &file_path)); CHECK_EQ(static_cast<int>(kUploadDataSize), @@ -473,17 +479,17 @@ class SpdyNetworkTransactionTest upload_data_stream_.reset( new ElementsUploadDataStream(element_readers.Pass(), 0)); - google_post_request_.method = "POST"; - google_post_request_.url = GURL(GetDefaultUrl()); - google_post_request_.upload_data_stream = upload_data_stream_.get(); - google_post_request_initialized_ = true; + post_request_.method = "POST"; + post_request_.url = GURL(GetDefaultUrl()); + post_request_.upload_data_stream = upload_data_stream_.get(); + post_request_initialized_ = true; } - return google_post_request_; + return post_request_; } const HttpRequestInfo& CreateUnreadableFilePostRequest() { - if (google_post_request_initialized_) - return google_post_request_; + if (post_request_initialized_) + return post_request_; base::FilePath file_path; CHECK(base::CreateTemporaryFileInDir(temp_dir_.path(), &file_path)); @@ -501,15 +507,15 @@ class SpdyNetworkTransactionTest upload_data_stream_.reset( new ElementsUploadDataStream(element_readers.Pass(), 0)); - google_post_request_.method = "POST"; - google_post_request_.url = GURL(GetDefaultUrl()); - google_post_request_.upload_data_stream = upload_data_stream_.get(); - google_post_request_initialized_ = true; - return google_post_request_; + post_request_.method = "POST"; + post_request_.url = GURL(GetDefaultUrl()); + post_request_.upload_data_stream = upload_data_stream_.get(); + post_request_initialized_ = true; + return post_request_; } const HttpRequestInfo& CreateComplexPostRequest() { - if (!google_post_request_initialized_) { + if (!post_request_initialized_) { const int kFileRangeOffset = 1; const int kFileRangeLength = 3; CHECK_LT(kFileRangeOffset + kFileRangeLength, kUploadDataSize); @@ -534,24 +540,24 @@ class SpdyNetworkTransactionTest upload_data_stream_.reset( new ElementsUploadDataStream(element_readers.Pass(), 0)); - google_post_request_.method = "POST"; - google_post_request_.url = GURL(GetDefaultUrl()); - google_post_request_.upload_data_stream = upload_data_stream_.get(); - google_post_request_initialized_ = true; + post_request_.method = "POST"; + post_request_.url = GURL(GetDefaultUrl()); + post_request_.upload_data_stream = upload_data_stream_.get(); + post_request_initialized_ = true; } - return google_post_request_; + return post_request_; } const HttpRequestInfo& CreateChunkedPostRequest() { - if (!google_chunked_post_request_initialized_) { + if (!chunked_post_request_initialized_) { upload_chunked_data_stream_.reset(new ChunkedUploadDataStream(0)); - google_chunked_post_request_.method = "POST"; - google_chunked_post_request_.url = GURL(GetDefaultUrl()); - google_chunked_post_request_.upload_data_stream = + chunked_post_request_.method = "POST"; + chunked_post_request_.url = GURL(GetDefaultUrl()); + chunked_post_request_.upload_data_stream = upload_chunked_data_stream_.get(); - google_chunked_post_request_initialized_ = true; + chunked_post_request_initialized_ = true; } - return google_chunked_post_request_; + return chunked_post_request_; } // Read the result of a particular transaction, knowing that we've got @@ -684,9 +690,9 @@ class SpdyNetworkTransactionTest const char* GetDefaultUrl() { switch (GetParam().ssl_type) { case HTTP_SPDY_VIA_ALT_SVC: - return "http://www.google.com"; + return "http://www.example.org"; case HTTPS_SPDY_VIA_NPN: - return "https://www.google.com"; + return "https://www.example.org"; default: NOTREACHED(); return ""; @@ -702,13 +708,13 @@ class SpdyNetworkTransactionTest private: scoped_ptr<ChunkedUploadDataStream> upload_chunked_data_stream_; scoped_ptr<UploadDataStream> upload_data_stream_; - bool google_get_request_initialized_; - bool google_post_request_initialized_; - bool google_chunked_post_request_initialized_; - HttpRequestInfo google_get_request_; - HttpRequestInfo google_post_request_; - HttpRequestInfo google_chunked_post_request_; - HttpRequestInfo google_get_push_request_; + bool get_request_initialized_; + bool post_request_initialized_; + bool chunked_post_request_initialized_; + HttpRequestInfo get_request_; + HttpRequestInfo post_request_; + HttpRequestInfo chunked_post_request_; + HttpRequestInfo get_push_request_; base::ScopedTempDir temp_dir_; }; @@ -2414,7 +2420,7 @@ TEST_P(SpdyNetworkTransactionTest, DeleteSessionOnReadCallback) { helper.VerifyDataConsumed(); } -// Send a spdy request to www.google.com that gets redirected to www.foo.com. +// Send a spdy request to www.example.org that gets redirected to www.foo.com. TEST_P(SpdyNetworkTransactionTest, DISABLED_RedirectGetRequest) { scoped_ptr<SpdyHeaderBlock> headers( spdy_util_.ConstructGetHeaderBlock(GetDefaultUrl())); @@ -2425,7 +2431,7 @@ TEST_P(SpdyNetworkTransactionTest, DISABLED_RedirectGetRequest) { (*headers2)["user-agent"] = ""; (*headers2)["accept-encoding"] = "gzip, deflate"; - // Setup writes/reads to www.google.com + // Setup writes/reads to www.example.org scoped_ptr<SpdyFrame> req( spdy_util_.ConstructSpdySyn(1, *headers, LOWEST, false, true)); scoped_ptr<SpdyFrame> req2( @@ -2486,7 +2492,7 @@ TEST_P(SpdyNetworkTransactionTest, DISABLED_RedirectGetRequest) { EXPECT_TRUE(data2.at_write_eof()); } -// Send a spdy request to www.google.com. Get a pushed stream that redirects to +// Send a spdy request to www.example.org. Get a pushed stream that redirects to // www.foo.com. TEST_P(SpdyNetworkTransactionTest, DISABLED_RedirectServerPush) { scoped_ptr<SpdyHeaderBlock> headers( @@ -2494,7 +2500,7 @@ TEST_P(SpdyNetworkTransactionTest, DISABLED_RedirectServerPush) { (*headers)["user-agent"] = ""; (*headers)["accept-encoding"] = "gzip, deflate"; - // Setup writes/reads to www.google.com + // Setup writes/reads to www.example.org scoped_ptr<SpdyFrame> req( spdy_util_.ConstructSpdySyn(1, *headers, LOWEST, false, true)); scoped_ptr<SpdyFrame> resp(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1)); @@ -3705,7 +3711,8 @@ TEST_P(SpdyNetworkTransactionTest, NetLog) { ASSERT_TRUE(entries[pos].params->GetList("headers", &header_list)); std::vector<std::string> expected; - expected.push_back(std::string(spdy_util_.GetHostKey()) + ": www.google.com"); + expected.push_back(std::string(spdy_util_.GetHostKey()) + + ": www.example.org"); expected.push_back(std::string(spdy_util_.GetPathKey()) + ": /"); expected.push_back(std::string(spdy_util_.GetSchemeKey()) + ": " + spdy_util_.default_url().scheme()); @@ -4189,7 +4196,7 @@ TEST_P(SpdyNetworkTransactionTest, SettingsSaved) { helper.RunPreTestSetup(); // Verify that no settings exist initially. - HostPortPair host_port_pair("www.google.com", helper.port()); + HostPortPair host_port_pair("www.example.org", helper.port()); SpdySessionPool* spdy_session_pool = helper.session()->spdy_session_pool(); EXPECT_TRUE(spdy_session_pool->http_server_properties()->GetSpdySettings( host_port_pair).empty()); @@ -4302,7 +4309,7 @@ TEST_P(SpdyNetworkTransactionTest, SettingsPlayback) { pool_peer.SetEnableSendingInitialData(true); // Verify that no settings exist initially. - HostPortPair host_port_pair("www.google.com", helper.port()); + HostPortPair host_port_pair("www.example.org", helper.port()); EXPECT_TRUE(spdy_session_pool->http_server_properties()->GetSpdySettings( host_port_pair).empty()); @@ -4498,7 +4505,7 @@ TEST_P(SpdyNetworkTransactionTest, HTTP11RequiredRetry) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL(GetDefaultUrl()); + request.url = GURL("https://www.example.org/"); scoped_ptr<SpdySessionDependencies> session_deps( CreateSpdySessionDependencies(GetParam())); // Do not force SPDY so that second socket can negotiate HTTP/1.1. @@ -4532,7 +4539,7 @@ TEST_P(SpdyNetworkTransactionTest, HTTP11RequiredRetry) { // Second socket: falling back to HTTP/1.1. MockWrite writes1[] = {MockWrite( "GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" + "Host: www.example.org\r\n" "Connection: keep-alive\r\n\r\n")}; MockRead reads1[] = {MockRead( "HTTP/1.1 200 OK\r\n" @@ -4589,7 +4596,7 @@ TEST_P(SpdyNetworkTransactionTest, HTTP11RequiredProxyRetry) { HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); scoped_ptr<SpdySessionDependencies> session_deps( CreateSpdySessionDependencies( GetParam(), @@ -4601,7 +4608,7 @@ TEST_P(SpdyNetworkTransactionTest, HTTP11RequiredProxyRetry) { // First socket: HTTP/2 CONNECT rejected with HTTP_1_1_REQUIRED. scoped_ptr<SpdyFrame> req(spdy_util_.ConstructSpdyConnect( - nullptr, 0, 1, LOWEST, HostPortPair("www.google.com", 443))); + nullptr, 0, 1, LOWEST, HostPortPair("www.example.org", 443))); MockWrite writes0[] = {CreateMockWrite(*req)}; scoped_ptr<SpdyFrame> go_away(spdy_util_.ConstructSpdyGoAway( 0, GOAWAY_HTTP_1_1_REQUIRED, "Try again using HTTP/1.1 please.")); @@ -4623,12 +4630,12 @@ TEST_P(SpdyNetworkTransactionTest, HTTP11RequiredProxyRetry) { // Second socket: retry using HTTP/1.1. MockWrite writes1[] = { MockWrite(ASYNC, 1, - "CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" "Proxy-Connection: keep-alive\r\n\r\n"), MockWrite(ASYNC, 3, "GET / HTTP/1.1\r\n" - "Host: www.google.com\r\n" + "Host: www.example.org\r\n" "Connection: keep-alive\r\n\r\n"), }; @@ -4695,8 +4702,8 @@ TEST_P(SpdyNetworkTransactionTest, ProxyConnect) { HttpNetworkTransaction* trans = helper.trans(); const char kConnect443[] = { - "CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" "Proxy-Connection: keep-alive\r\n\r\n"}; const char kHTTP200[] = {"HTTP/1.1 200 OK\r\n\r\n"}; scoped_ptr<SpdyFrame> req( @@ -4738,9 +4745,9 @@ TEST_P(SpdyNetworkTransactionTest, ProxyConnect) { helper.VerifyDataConsumed(); } -// Test to make sure we can correctly connect through a proxy to www.google.com, -// if there already exists a direct spdy connection to www.google.com. See -// http://crbug.com/49874 +// Test to make sure we can correctly connect through a proxy to +// www.example.org, if there already exists a direct spdy connection to +// www.example.org. See https://crbug.com/49874. TEST_P(SpdyNetworkTransactionTest, DirectConnectProxyReconnect) { // When setting up the first transaction, we store the SpdySessionPool so that // we can use the same pool in the second transaction. @@ -4799,7 +4806,7 @@ TEST_P(SpdyNetworkTransactionTest, DirectConnectProxyReconnect) { EXPECT_EQ("hello!", out.response_data); // Check that the SpdySession is still in the SpdySessionPool. - HostPortPair host_port_pair("www.google.com", helper.port()); + HostPortPair host_port_pair("www.example.org", helper.port()); SpdySessionKey session_pool_key_direct( host_port_pair, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); EXPECT_TRUE(HasSpdySession(spdy_session_pool, session_pool_key_direct)); @@ -4810,9 +4817,10 @@ TEST_P(SpdyNetworkTransactionTest, DirectConnectProxyReconnect) { EXPECT_FALSE(HasSpdySession(spdy_session_pool, session_pool_key_proxy)); // Set up data for the proxy connection. - const char kConnect443[] = {"CONNECT www.google.com:443 HTTP/1.1\r\n" - "Host: www.google.com\r\n" - "Proxy-Connection: keep-alive\r\n\r\n"}; + const char kConnect443[] = { + "CONNECT www.example.org:443 HTTP/1.1\r\n" + "Host: www.example.org\r\n" + "Proxy-Connection: keep-alive\r\n\r\n"}; const char kHTTP200[] = {"HTTP/1.1 200 OK\r\n\r\n"}; scoped_ptr<SpdyFrame> req2(spdy_util_.ConstructSpdyGet( GetDefaultUrlWithPath("/foo.dat").c_str(), false, 1, LOWEST)); @@ -4833,7 +4841,7 @@ TEST_P(SpdyNetworkTransactionTest, DirectConnectProxyReconnect) { scoped_ptr<OrderedSocketData> data_proxy(new OrderedSocketData( reads2, arraysize(reads2), writes2, arraysize(writes2))); - // Create another request to www.google.com, but this time through a proxy. + // Create another request to www.example.org, but this time through a proxy. HttpRequestInfo request_proxy; request_proxy.method = "GET"; request_proxy.url = GURL(GetDefaultUrlWithPath("/foo.dat")); @@ -5616,19 +5624,19 @@ TEST_P(SpdyNetworkTransactionTest, ServerPushCrossOriginCorrectness) { // A list of the URL to fetch, followed by the URL being pushed. static const char* const kTestCases[] = { - "https://www.google.com/foo.html", - "https://www.google.com:81/foo.js", // Bad port + "https://www.example.org/foo.html", + "https://www.example.org:81/foo.js", // Bad port - "https://www.google.com/foo.html", - "http://www.google.com/foo.js", // Bad protocol + "https://www.example.org/foo.html", + "http://www.example.org/foo.js", // Bad protocol - "https://www.google.com/foo.html", - "ftp://www.google.com/foo.js", // Invalid Protocol + "https://www.example.org/foo.html", + "ftp://www.example.org/foo.js", // Invalid Protocol - "https://www.google.com/foo.html", - "https://blat.www.google.com/foo.js", // Cross subdomain + "https://www.example.org/foo.html", + "https://blat.www.example.org/foo.js", // Cross subdomain - "https://www.google.com/foo.html", + "https://www.example.org/foo.html", "https://www.foo.com/foo.js", // Cross domain }; @@ -6536,7 +6544,7 @@ TEST_P(SpdyNetworkTransactionTest, GoAwayOnOddPushStreamId) { return; scoped_ptr<SpdyHeaderBlock> push_headers(new SpdyHeaderBlock); - spdy_util_.AddUrlToHeaderBlock("http://www.google.com/a.dat", + spdy_util_.AddUrlToHeaderBlock("http://www.example.org/a.dat", push_headers.get()); scoped_ptr<SpdyFrame> push( spdy_util_.ConstructInitialSpdyPushFrame(push_headers.Pass(), 3, 1)); @@ -6612,7 +6620,7 @@ class SpdyNetworkTransactionNoTLSUsageCheckTest 1, reads, arraysize(reads), writes, arraysize(writes)); HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); NormalSpdyTransactionHelper helper( request, DEFAULT_PRIORITY, BoundNetLog(), GetParam(), NULL); helper.RunToCompletionWithSSLData(&data, ssl_provider.Pass()); @@ -6664,7 +6672,7 @@ class SpdyNetworkTransactionTLSUsageCheckTest DelayedSocketData data(1, NULL, 0, writes, arraysize(writes)); HttpRequestInfo request; request.method = "GET"; - request.url = GURL("https://www.google.com/"); + request.url = GURL("https://www.example.org/"); NormalSpdyTransactionHelper helper( request, DEFAULT_PRIORITY, BoundNetLog(), GetParam(), NULL); helper.RunToCompletionWithSSLData(&data, ssl_provider.Pass()); diff --git a/net/spdy/spdy_session_unittest.cc b/net/spdy/spdy_session_unittest.cc index af8ba39..a470606 100644 --- a/net/spdy/spdy_session_unittest.cc +++ b/net/spdy/spdy_session_unittest.cc @@ -1192,13 +1192,13 @@ TEST_P(SpdySessionTest, DeleteExpiredPushStreams) { spdy_util_.ConstructSpdyRstStream(2, RST_STREAM_REFUSED_STREAM)); scoped_ptr<SpdyFrame> push_a(spdy_util_.ConstructSpdyPush( - NULL, 0, 2, 1, "http://www.google.com/a.dat")); + NULL, 0, 2, 1, "http://www.example.org/a.dat")); scoped_ptr<SpdyFrame> push_a_body( spdy_util_.ConstructSpdyBodyFrame(2, false)); // In ascii "0" < "a". We use it to verify that we properly handle std::map // iterators inside. See http://crbug.com/443490 scoped_ptr<SpdyFrame> push_b(spdy_util_.ConstructSpdyPush( - NULL, 0, 4, 1, "http://www.google.com/0.dat")); + NULL, 0, 4, 1, "http://www.example.org/0.dat")); MockWrite writes[] = {CreateMockWrite(*req, 0), CreateMockWrite(*rst, 4)}; MockRead reads[] = { CreateMockRead(*push_a, 1), CreateMockRead(*push_a_body, 2), @@ -1232,7 +1232,7 @@ TEST_P(SpdySessionTest, DeleteExpiredPushStreams) { EXPECT_EQ(1u, session->num_unclaimed_pushed_streams()); SpdySession::PushedStreamMap::iterator iter = session->unclaimed_pushed_streams_.find( - GURL("http://www.google.com/a.dat")); + GURL("http://www.example.org/a.dat")); EXPECT_TRUE(session->unclaimed_pushed_streams_.end() != iter); if (session->flow_control_state_ == @@ -1252,7 +1252,7 @@ TEST_P(SpdySessionTest, DeleteExpiredPushStreams) { // Verify that the second pushed stream evicted the first pushed stream. EXPECT_EQ(1u, session->num_unclaimed_pushed_streams()); iter = session->unclaimed_pushed_streams_.find( - GURL("http://www.google.com/0.dat")); + GURL("http://www.example.org/0.dat")); EXPECT_TRUE(session->unclaimed_pushed_streams_.end() != iter); if (session->flow_control_state_ == @@ -1787,7 +1787,7 @@ TEST_P(SpdySessionTest, SynCompressionHistograms) { break; case SPDY4: histogram_tester.ExpectBucketCount( - "Net.SpdySynStreamCompressionPercentage", 82, 1); + "Net.SpdySynStreamCompressionPercentage", 81, 1); break; default: NOTREACHED(); @@ -3303,7 +3303,7 @@ TEST_P(SpdySessionTest, CloseSessionOnIdleWhenPoolStalled) { TEST_P(SpdySessionTest, SpdySessionKeyPrivacyMode) { CreateDeterministicNetworkSession(); - HostPortPair host_port_pair("www.google.com", 443); + HostPortPair host_port_pair("www.example.org", 443); SpdySessionKey key_privacy_enabled(host_port_pair, ProxyServer::Direct(), PRIVACY_MODE_ENABLED); SpdySessionKey key_privacy_disabled(host_port_pair, ProxyServer::Direct(), @@ -3674,7 +3674,7 @@ TEST_P(SpdySessionTest, SessionFlowControlNoReceiveLeaks) { if (GetParam() < kProtoSPDY31) return; - const char kStreamUrl[] = "http://www.google.com/"; + const char kStreamUrl[] = "http://www.example.org/"; const int32 msg_data_size = 100; const std::string msg_data(msg_data_size, 'a'); @@ -3762,7 +3762,7 @@ TEST_P(SpdySessionTest, SessionFlowControlNoSendLeaks) { if (GetParam() < kProtoSPDY31) return; - const char kStreamUrl[] = "http://www.google.com/"; + const char kStreamUrl[] = "http://www.example.org/"; const int32 msg_data_size = 100; const std::string msg_data(msg_data_size, 'a'); @@ -3841,7 +3841,7 @@ TEST_P(SpdySessionTest, SessionFlowControlEndToEnd) { if (GetParam() < kProtoSPDY31) return; - const char kStreamUrl[] = "http://www.google.com/"; + const char kStreamUrl[] = "http://www.example.org/"; const int32 msg_data_size = 100; const std::string msg_data(msg_data_size, 'a'); @@ -3969,7 +3969,7 @@ void SpdySessionTest::RunResumeAfterUnstallTest( const base::Callback<void(SpdySession*, SpdyStream*)>& stall_function, const base::Callback<void(SpdySession*, SpdyStream*, int32)>& unstall_function) { - const char kStreamUrl[] = "http://www.google.com/"; + const char kStreamUrl[] = "http://www.example.org/"; GURL url(kStreamUrl); session_deps_.host_resolver->set_synchronous_mode(true); @@ -4122,7 +4122,7 @@ TEST_P(SpdySessionTest, ResumeByPriorityAfterSendWindowSizeIncrease) { if (GetParam() < kProtoSPDY31) return; - const char kStreamUrl[] = "http://www.google.com/"; + const char kStreamUrl[] = "http://www.example.org/"; GURL url(kStreamUrl); session_deps_.host_resolver->set_synchronous_mode(true); @@ -4276,7 +4276,7 @@ TEST_P(SpdySessionTest, SendWindowSizeIncreaseWithDeletedStreams) { if (GetParam() < kProtoSPDY31) return; - const char kStreamUrl[] = "http://www.google.com/"; + const char kStreamUrl[] = "http://www.example.org/"; GURL url(kStreamUrl); session_deps_.host_resolver->set_synchronous_mode(true); @@ -4438,7 +4438,7 @@ TEST_P(SpdySessionTest, SendWindowSizeIncreaseWithDeletedSession) { if (GetParam() < kProtoSPDY31) return; - const char kStreamUrl[] = "http://www.google.com/"; + const char kStreamUrl[] = "http://www.example.org/"; GURL url(kStreamUrl); session_deps_.host_resolver->set_synchronous_mode(true); @@ -4604,7 +4604,7 @@ TEST_P(SpdySessionTest, GoAwayOnSessionFlowControlError) { } TEST_P(SpdySessionTest, SplitHeaders) { - GURL kStreamUrl("http://www.google.com/foo.dat"); + GURL kStreamUrl("http://www.example.org/foo.dat"); SpdyHeaderBlock headers; spdy_util_.AddUrlToHeaderBlock(kStreamUrl.spec(), &headers); headers["alpha"] = "beta"; @@ -4634,7 +4634,7 @@ TEST_P(SpdySessionTest, PushedStreamShouldNotCountToClientConcurrencyLimit) { scoped_ptr<SpdyFrame> settings_frame( spdy_util_.ConstructSpdySettings(new_settings)); scoped_ptr<SpdyFrame> pushed(spdy_util_.ConstructSpdyPush( - NULL, 0, 2, 1, "http://www.google.com/a.dat")); + NULL, 0, 2, 1, "http://www.example.org/a.dat")); MockRead reads[] = { CreateMockRead(*settings_frame), CreateMockRead(*pushed, 3), MockRead(ASYNC, 0, 4), @@ -4712,9 +4712,9 @@ TEST_P(SpdySessionTest, PushedStreamShouldNotCountToClientConcurrencyLimit) { TEST_P(SpdySessionTest, RejectPushedStreamExceedingConcurrencyLimit) { scoped_ptr<SpdyFrame> push_a(spdy_util_.ConstructSpdyPush( - NULL, 0, 2, 1, "http://www.google.com/a.dat")); + NULL, 0, 2, 1, "http://www.example.org/a.dat")); scoped_ptr<SpdyFrame> push_b(spdy_util_.ConstructSpdyPush( - NULL, 0, 4, 1, "http://www.google.com/b.dat")); + NULL, 0, 4, 1, "http://www.example.org/b.dat")); MockRead reads[] = { CreateMockRead(*push_a, 1), CreateMockRead(*push_b, 2), MockRead(ASYNC, 0, 4), @@ -4791,9 +4791,9 @@ TEST_P(SpdySessionTest, IgnoreReservedRemoteStreamsCount) { return; scoped_ptr<SpdyFrame> push_a(spdy_util_.ConstructSpdyPush( - NULL, 0, 2, 1, "http://www.google.com/a.dat")); + NULL, 0, 2, 1, "http://www.example.org/a.dat")); scoped_ptr<SpdyHeaderBlock> push_headers(new SpdyHeaderBlock); - spdy_util_.AddUrlToHeaderBlock("http://www.google.com/b.dat", + spdy_util_.AddUrlToHeaderBlock("http://www.example.org/b.dat", push_headers.get()); scoped_ptr<SpdyFrame> push_b( spdy_util_.ConstructInitialSpdyPushFrame(push_headers.Pass(), 4, 1)); @@ -4882,7 +4882,7 @@ TEST_P(SpdySessionTest, CancelReservedStreamOnHeadersReceived) { if (spdy_util_.spdy_version() < SPDY4) return; - const char kPushedUrl[] = "http://www.google.com/a.dat"; + const char kPushedUrl[] = "http://www.example.org/a.dat"; scoped_ptr<SpdyHeaderBlock> push_headers(new SpdyHeaderBlock); spdy_util_.AddUrlToHeaderBlock(kPushedUrl, push_headers.get()); scoped_ptr<SpdyFrame> push_promise( diff --git a/net/spdy/spdy_stream_unittest.cc b/net/spdy/spdy_stream_unittest.cc index fc8d35f..15f6730 100644 --- a/net/spdy/spdy_stream_unittest.cc +++ b/net/spdy/spdy_stream_unittest.cc @@ -32,7 +32,7 @@ namespace test { namespace { -const char kStreamUrl[] = "http://www.google.com/"; +const char kStreamUrl[] = "http://www.example.org/"; const char kPostBody[] = "\0hello!\xff"; const size_t kPostBodyLength = arraysize(kPostBody); const base::StringPiece kPostBodyStringPiece(kPostBody, kPostBodyLength); @@ -51,9 +51,8 @@ class SpdyStreamTest : public ::testing::Test, offset_(0) {} base::WeakPtr<SpdySession> CreateDefaultSpdySession() { - SpdySessionKey key(HostPortPair("www.google.com", 80), - ProxyServer::Direct(), - PRIVACY_MODE_DISABLED); + SpdySessionKey key(HostPortPair("www.example.org", 80), + ProxyServer::Direct(), PRIVACY_MODE_DISABLED); return CreateInsecureSpdySession(session_, key, BoundNetLog()); } diff --git a/net/spdy/spdy_test_util_common.h b/net/spdy/spdy_test_util_common.h index d95b69f..781dbb2 100644 --- a/net/spdy/spdy_test_util_common.h +++ b/net/spdy/spdy_test_util_common.h @@ -44,7 +44,7 @@ class SpdyStreamRequest; // Default upload data used by both, mock objects and framer when creating // data frames. -const char kDefaultURL[] = "http://www.google.com"; +const char kDefaultURL[] = "http://www.example.org"; const char kUploadData[] = "hello!"; const int kUploadDataSize = arraysize(kUploadData)-1; |