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

Side by Side Diff: net/http/http_network_transaction_unittest.cc

Issue 9816011: Add support for 308 permanent redirects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Add response code check Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/http_network_transaction.h" 5 #include "net/http/http_network_transaction.h"
6 6
7 #include <math.h> // ceil 7 #include <math.h> // ceil
8 #include <stdarg.h> 8 #include <stdarg.h>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 3932 matching lines...) Expand 10 before | Expand all | Expand 10 after
3943 } 3943 }
3944 3944
3945 TEST_P(HttpNetworkTransactionTest, ConnectStatus306) { 3945 TEST_P(HttpNetworkTransactionTest, ConnectStatus306) {
3946 ConnectStatusHelper(MockRead("HTTP/1.1 306\r\n")); 3946 ConnectStatusHelper(MockRead("HTTP/1.1 306\r\n"));
3947 } 3947 }
3948 3948
3949 TEST_P(HttpNetworkTransactionTest, ConnectStatus307) { 3949 TEST_P(HttpNetworkTransactionTest, ConnectStatus307) {
3950 ConnectStatusHelper(MockRead("HTTP/1.1 307 Temporary Redirect\r\n")); 3950 ConnectStatusHelper(MockRead("HTTP/1.1 307 Temporary Redirect\r\n"));
3951 } 3951 }
3952 3952
3953 TEST_P(HttpNetworkTransactionTest, ConnectStatus308) {
3954 ConnectStatusHelper(MockRead("HTTP/1.1 308 Permanent Redirect\r\n"));
3955 }
3956
3953 TEST_P(HttpNetworkTransactionTest, ConnectStatus400) { 3957 TEST_P(HttpNetworkTransactionTest, ConnectStatus400) {
3954 ConnectStatusHelper(MockRead("HTTP/1.1 400 Bad Request\r\n")); 3958 ConnectStatusHelper(MockRead("HTTP/1.1 400 Bad Request\r\n"));
3955 } 3959 }
3956 3960
3957 TEST_P(HttpNetworkTransactionTest, ConnectStatus401) { 3961 TEST_P(HttpNetworkTransactionTest, ConnectStatus401) {
3958 ConnectStatusHelper(MockRead("HTTP/1.1 401 Unauthorized\r\n")); 3962 ConnectStatusHelper(MockRead("HTTP/1.1 401 Unauthorized\r\n"));
3959 } 3963 }
3960 3964
3961 TEST_P(HttpNetworkTransactionTest, ConnectStatus402) { 3965 TEST_P(HttpNetworkTransactionTest, ConnectStatus402) {
3962 ConnectStatusHelper(MockRead("HTTP/1.1 402 Payment Required\r\n")); 3966 ConnectStatusHelper(MockRead("HTTP/1.1 402 Payment Required\r\n"));
(...skipping 8636 matching lines...) Expand 10 before | Expand all | Expand 10 after
12599 // established, to let the HTTP request start. 12603 // established, to let the HTTP request start.
12600 ASSERT_EQ(OK, http_callback.WaitForResult()); 12604 ASSERT_EQ(OK, http_callback.WaitForResult());
12601 std::string response_data; 12605 std::string response_data;
12602 ASSERT_EQ(OK, ReadTransaction(http_trans.get(), &response_data)); 12606 ASSERT_EQ(OK, ReadTransaction(http_trans.get(), &response_data));
12603 EXPECT_EQ("falafel", response_data); 12607 EXPECT_EQ("falafel", response_data);
12604 12608
12605 EXPECT_EQ(1, GetIdleSocketCountInTransportSocketPool(session)); 12609 EXPECT_EQ(1, GetIdleSocketCountInTransportSocketPool(session));
12606 } 12610 }
12607 12611
12608 } // namespace net 12612 } // namespace net
OLDNEW
« no previous file with comments | « net/data/url_request_unittest/redirect308-to-echo.mock-http-headers ('k') | net/http/http_response_headers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698