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 3478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3489 TransactionHelperResult out = helper.output(); | 3489 TransactionHelperResult out = helper.output(); |
3490 EXPECT_EQ(OK, out.rv); | 3490 EXPECT_EQ(OK, out.rv); |
3491 EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); | 3491 EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); |
3492 EXPECT_EQ("hello!", out.response_data); | 3492 EXPECT_EQ("hello!", out.response_data); |
3493 } | 3493 } |
3494 | 3494 |
3495 // In this test, we enable compression, but get a uncompressed SynReply from | 3495 // In this test, we enable compression, but get a uncompressed SynReply from |
3496 // the server. Verify that teardown is all clean. | 3496 // the server. Verify that teardown is all clean. |
3497 TEST_P(SpdyNetworkTransactionSpdy2Test, DecompressFailureOnSynReply) { | 3497 TEST_P(SpdyNetworkTransactionSpdy2Test, DecompressFailureOnSynReply) { |
3498 // For this test, we turn on the normal compression. | 3498 // For this test, we turn on the normal compression. |
3499 SpdyFramer::set_enable_compression_default(true); | 3499 BufferedSpdyFramer::set_enable_compression_default(true); |
3500 | 3500 |
3501 scoped_ptr<SpdyFrame> compressed( | 3501 scoped_ptr<SpdyFrame> compressed( |
3502 ConstructSpdyGet(NULL, 0, true, 1, LOWEST)); | 3502 ConstructSpdyGet(NULL, 0, true, 1, LOWEST)); |
3503 scoped_ptr<SpdyFrame> rst( | 3503 scoped_ptr<SpdyFrame> rst( |
3504 ConstructSpdyRstStream(1, PROTOCOL_ERROR)); | 3504 ConstructSpdyRstStream(1, PROTOCOL_ERROR)); |
3505 MockWrite writes[] = { | 3505 MockWrite writes[] = { |
3506 CreateMockWrite(*compressed), | 3506 CreateMockWrite(*compressed), |
3507 }; | 3507 }; |
3508 | 3508 |
3509 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); | 3509 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); |
(...skipping 2040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5550 << " Write index: " | 5550 << " Write index: " |
5551 << data->write_index(); | 5551 << data->write_index(); |
5552 | 5552 |
5553 // Verify the SYN_REPLY. | 5553 // Verify the SYN_REPLY. |
5554 HttpResponseInfo response = *trans->GetResponseInfo(); | 5554 HttpResponseInfo response = *trans->GetResponseInfo(); |
5555 EXPECT_TRUE(response.headers != NULL); | 5555 EXPECT_TRUE(response.headers != NULL); |
5556 EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); | 5556 EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); |
5557 } | 5557 } |
5558 | 5558 |
5559 } // namespace net | 5559 } // namespace net |
OLD | NEW |