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

Unified Diff: net/http/http_network_transaction_unittest.cc

Issue 303443011: Retry requests on reused sockets when receiving 408 responses. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix indent Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_network_transaction.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9e3b8d66b6d5c1757fe175e5655545a60b3c3376 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);
+}
+
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);
« no previous file with comments | « net/http/http_network_transaction.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698