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

Unified Diff: net/http/http_network_transaction_spdy21_unittest.cc

Issue 9757002: Allow multiple identical Location and Content-Disposition headers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix comments, update strings Created 8 years, 9 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 | « chrome/app/generated_resources.grd ('k') | net/http/http_network_transaction_spdy2_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_transaction_spdy21_unittest.cc
===================================================================
--- net/http/http_network_transaction_spdy21_unittest.cc (revision 127472)
+++ net/http/http_network_transaction_spdy21_unittest.cc (working copy)
@@ -691,9 +691,9 @@
EXPECT_EQ("Hello", out.response_data);
}
-// Checks that two identical Content-Disposition headers result in an error.
+// Checks that two identical Content-Disposition headers result in no error.
TEST_F(HttpNetworkTransactionSpdy21Test,
- DuplicateIdenticalContentDispositionHeaders) {
+ TwoIdenticalContentDispositionHeaders) {
MockRead data_reads[] = {
MockRead("HTTP/1.1 200 OK\r\n"),
MockRead("Content-Disposition: attachment;filename=\"greetings.txt\"r\n"),
@@ -703,12 +703,13 @@
};
SimpleGetHelperResult out = SimpleGetHelper(data_reads,
arraysize(data_reads));
- EXPECT_EQ(ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION, out.rv);
+ EXPECT_EQ(OK, out.rv);
+ EXPECT_EQ("HTTP/1.1 200 OK", out.status_line);
+ EXPECT_EQ("Hello", out.response_data);
}
// Checks that two distinct Content-Disposition headers result in an error.
-TEST_F(HttpNetworkTransactionSpdy21Test,
- DuplicateDistinctContentDispositionHeaders) {
+TEST_F(HttpNetworkTransactionSpdy21Test, TwoDistinctContentDispositionHeaders) {
MockRead data_reads[] = {
MockRead("HTTP/1.1 200 OK\r\n"),
MockRead("Content-Disposition: attachment;filename=\"greetings.txt\"r\n"),
@@ -721,11 +722,13 @@
EXPECT_EQ(ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION, out.rv);
}
-// Checks the behavior of a single Location header.
-TEST_F(HttpNetworkTransactionSpdy21Test, SingleLocationHeader) {
+// Checks that two identical Location headers result in no error.
+// Also tests Location header behavior.
+TEST_F(HttpNetworkTransactionSpdy21Test, TwoIdenticalLocationHeaders) {
MockRead data_reads[] = {
MockRead("HTTP/1.1 302 Redirect\r\n"),
MockRead("Location: http://good.com/\r\n"),
+ MockRead("Location: http://good.com/\r\n"),
MockRead("Content-Length: 0\r\n\r\n"),
MockRead(SYNCHRONOUS, OK),
};
@@ -757,22 +760,8 @@
EXPECT_EQ("http://good.com/", url);
}
-// Checks that two identical Location headers result in an error.
-TEST_F(HttpNetworkTransactionSpdy21Test, DuplicateIdenticalLocationHeaders) {
- MockRead data_reads[] = {
- MockRead("HTTP/1.1 302 Redirect\r\n"),
- MockRead("Location: http://good.com/\r\n"),
- MockRead("Location: http://good.com/\r\n"),
- MockRead("Content-Length: 0\r\n\r\n"),
- MockRead(SYNCHRONOUS, OK),
- };
- SimpleGetHelperResult out = SimpleGetHelper(data_reads,
- arraysize(data_reads));
- EXPECT_EQ(ERR_RESPONSE_HEADERS_MULTIPLE_LOCATION, out.rv);
-}
-
// Checks that two distinct Location headers result in an error.
-TEST_F(HttpNetworkTransactionSpdy21Test, DuplicateDistinctLocationHeaders) {
+TEST_F(HttpNetworkTransactionSpdy21Test, TwoDistinctLocationHeaders) {
MockRead data_reads[] = {
MockRead("HTTP/1.1 302 Redirect\r\n"),
MockRead("Location: http://good.com/\r\n"),
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | net/http/http_network_transaction_spdy2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698