OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 4052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4063 TransactionHelperResult out = helper.output(); | 4063 TransactionHelperResult out = helper.output(); |
4064 EXPECT_EQ(OK, out.rv); | 4064 EXPECT_EQ(OK, out.rv); |
4065 EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); | 4065 EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); |
4066 EXPECT_EQ("hello!", out.response_data); | 4066 EXPECT_EQ("hello!", out.response_data); |
4067 } | 4067 } |
4068 | 4068 |
4069 // In this test, we enable compression, but get a uncompressed SynReply from | 4069 // In this test, we enable compression, but get a uncompressed SynReply from |
4070 // the server. Verify that teardown is all clean. | 4070 // the server. Verify that teardown is all clean. |
4071 TEST_P(SpdyNetworkTransactionSpdy3Test, DecompressFailureOnSynReply) { | 4071 TEST_P(SpdyNetworkTransactionSpdy3Test, DecompressFailureOnSynReply) { |
4072 // For this test, we turn on the normal compression. | 4072 // For this test, we turn on the normal compression. |
4073 SpdyFramer::set_enable_compression_default(true); | 4073 BufferedSpdyFramer::set_enable_compression_default(true); |
4074 | 4074 |
4075 scoped_ptr<SpdyFrame> compressed( | 4075 scoped_ptr<SpdyFrame> compressed( |
4076 ConstructSpdyGet(NULL, 0, true, 1, LOWEST)); | 4076 ConstructSpdyGet(NULL, 0, true, 1, LOWEST)); |
4077 scoped_ptr<SpdyFrame> rst( | 4077 scoped_ptr<SpdyFrame> rst( |
4078 ConstructSpdyRstStream(1, PROTOCOL_ERROR)); | 4078 ConstructSpdyRstStream(1, PROTOCOL_ERROR)); |
4079 MockWrite writes[] = { | 4079 MockWrite writes[] = { |
4080 CreateMockWrite(*compressed), | 4080 CreateMockWrite(*compressed), |
4081 }; | 4081 }; |
4082 | 4082 |
4083 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); | 4083 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); |
(...skipping 2048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6132 << " Write index: " | 6132 << " Write index: " |
6133 << data->write_index(); | 6133 << data->write_index(); |
6134 | 6134 |
6135 // Verify the SYN_REPLY. | 6135 // Verify the SYN_REPLY. |
6136 HttpResponseInfo response = *trans->GetResponseInfo(); | 6136 HttpResponseInfo response = *trans->GetResponseInfo(); |
6137 EXPECT_TRUE(response.headers != NULL); | 6137 EXPECT_TRUE(response.headers != NULL); |
6138 EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); | 6138 EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); |
6139 } | 6139 } |
6140 | 6140 |
6141 } // namespace net | 6141 } // namespace net |
OLD | NEW |