| 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/tools/quic/quic_client_session.h" | 5 #include "net/tools/quic/quic_client_session.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "net/base/ip_endpoint.h" | 9 #include "net/base/ip_endpoint.h" |
| 10 #include "net/quic/crypto/aes_128_gcm_12_encrypter.h" | 10 #include "net/quic/crypto/aes_128_gcm_12_encrypter.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 stream = session_->CreateOutgoingDataStream(); | 84 stream = session_->CreateOutgoingDataStream(); |
| 85 EXPECT_TRUE(stream); | 85 EXPECT_TRUE(stream); |
| 86 } | 86 } |
| 87 | 87 |
| 88 TEST_P(ToolsQuicClientSessionTest, GoAwayReceived) { | 88 TEST_P(ToolsQuicClientSessionTest, GoAwayReceived) { |
| 89 CompleteCryptoHandshake(); | 89 CompleteCryptoHandshake(); |
| 90 | 90 |
| 91 // After receiving a GoAway, I should no longer be able to create outgoing | 91 // After receiving a GoAway, I should no longer be able to create outgoing |
| 92 // streams. | 92 // streams. |
| 93 session_->OnGoAway(QuicGoAwayFrame(QUIC_PEER_GOING_AWAY, 1u, "Going away.")); | 93 session_->OnGoAway(QuicGoAwayFrame(QUIC_PEER_GOING_AWAY, 1u, "Going away.")); |
| 94 EXPECT_EQ(NULL, session_->CreateOutgoingDataStream()); | 94 EXPECT_EQ(nullptr, session_->CreateOutgoingDataStream()); |
| 95 } | 95 } |
| 96 | 96 |
| 97 TEST_P(ToolsQuicClientSessionTest, SetFecProtectionFromConfig) { | 97 TEST_P(ToolsQuicClientSessionTest, SetFecProtectionFromConfig) { |
| 98 ValueRestore<bool> old_flag(&FLAGS_enable_quic_fec, true); | 98 ValueRestore<bool> old_flag(&FLAGS_enable_quic_fec, true); |
| 99 | 99 |
| 100 // Set FEC config in client's connection options. | 100 // Set FEC config in client's connection options. |
| 101 QuicTagVector copt; | 101 QuicTagVector copt; |
| 102 copt.push_back(kFHDR); | 102 copt.push_back(kFHDR); |
| 103 session_->config()->SetConnectionOptionsToSend(copt); | 103 session_->config()->SetConnectionOptionsToSend(copt); |
| 104 | 104 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // Close connection shouldn't be called. | 144 // Close connection shouldn't be called. |
| 145 EXPECT_CALL(*connection_, SendConnectionCloseWithDetails(_, _)).Times(0); | 145 EXPECT_CALL(*connection_, SendConnectionCloseWithDetails(_, _)).Times(0); |
| 146 session_->connection()->ProcessUdpPacket(client_address, server_address, | 146 session_->connection()->ProcessUdpPacket(client_address, server_address, |
| 147 valid_packet); | 147 valid_packet); |
| 148 } | 148 } |
| 149 | 149 |
| 150 } // namespace | 150 } // namespace |
| 151 } // namespace test | 151 } // namespace test |
| 152 } // namespace tools | 152 } // namespace tools |
| 153 } // namespace net | 153 } // namespace net |
| OLD | NEW |