Chromium Code Reviews| Index: net/http/http_network_transaction_unittest.cc |
| diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc |
| index 4381646c3bd34a1cbfe7f2b3cf70e69e7bf06a53..a3090f0ff25d09e1cbab37d096b29ff3d2e9f62a 100644 |
| --- a/net/http/http_network_transaction_unittest.cc |
| +++ b/net/http/http_network_transaction_unittest.cc |
| @@ -1439,6 +1439,17 @@ TEST_P(HttpNetworkTransactionTest, KeepAliveConnectionEOF) { |
| KeepAliveConnectionResendRequestTest(NULL, &read_failure); |
| } |
| +// Make sure that on a 408 response (Request Timeout), the request is retried, |
| +// if the socket was a reused keep alive socket. |
| +TEST_P(HttpNetworkTransactionTest, KeepAlive408) { |
| + MockRead read_failure(SYNCHRONOUS, |
| + "HTTP/1.1 408 Request Timeout\r\n" |
| + "Connection: Keep-Alive\r\n" |
| + "Content-Length: 6\r\n\r\n" |
| + "Pickle"); |
| + KeepAliveConnectionResendRequestTest(NULL, &read_failure); |
|
willchan no longer on Chromium
2014/06/03 21:01:02
Indentation is off
mmenke
2014/06/03 22:45:58
Done.
|
| +} |
| + |
| TEST_P(HttpNetworkTransactionTest, |
| PreconnectErrorNotConnectedOnWrite) { |
| MockWrite write_failure(ASYNC, ERR_SOCKET_NOT_CONNECTED); |
| @@ -1460,6 +1471,18 @@ TEST_P(HttpNetworkTransactionTest, PreconnectErrorAsyncEOF) { |
| PreconnectErrorResendRequestTest(NULL, &read_failure, false); |
| } |
| +// Make sure that on a 408 response (Request Timeout), the request is retried, |
| +// if the socket was a preconnected (UNUSED_IDLE) socket. |
| +TEST_P(HttpNetworkTransactionTest, RetryOnIdle408) { |
| + MockRead read_failure(SYNCHRONOUS, |
| + "HTTP/1.1 408 Request Timeout\r\n" |
| + "Connection: Keep-Alive\r\n" |
| + "Content-Length: 6\r\n\r\n" |
| + "Pickle"); |
| + KeepAliveConnectionResendRequestTest(NULL, &read_failure); |
| + PreconnectErrorResendRequestTest(NULL, &read_failure, false); |
| +} |
| + |
| TEST_P(HttpNetworkTransactionTest, |
| SpdyPreconnectErrorNotConnectedOnWrite) { |
| MockWrite write_failure(ASYNC, ERR_SOCKET_NOT_CONNECTED); |