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/quic/quic_connection.h" | 5 #include "net/quic/quic_connection.h" |
6 | 6 |
7 #include <ostream> | 7 #include <ostream> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 5554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5565 | 5565 |
5566 TEST_P(QuicConnectionTest, SendingUnencryptedStreamDataFails) { | 5566 TEST_P(QuicConnectionTest, SendingUnencryptedStreamDataFails) { |
5567 FLAGS_quic_never_write_unencrypted_data = true; | 5567 FLAGS_quic_never_write_unencrypted_data = true; |
5568 EXPECT_CALL(visitor_, | 5568 EXPECT_CALL(visitor_, |
5569 OnConnectionClosed(QUIC_UNENCRYPTED_STREAM_DATA, false)); | 5569 OnConnectionClosed(QUIC_UNENCRYPTED_STREAM_DATA, false)); |
5570 EXPECT_DFATAL(connection_.SendStreamDataWithString(3, "", 0, kFin, nullptr), | 5570 EXPECT_DFATAL(connection_.SendStreamDataWithString(3, "", 0, kFin, nullptr), |
5571 "Cannot send stream data without encryption."); | 5571 "Cannot send stream data without encryption."); |
5572 EXPECT_FALSE(connection_.connected()); | 5572 EXPECT_FALSE(connection_.connected()); |
5573 } | 5573 } |
5574 | 5574 |
| 5575 TEST_P(QuicConnectionTest, EnableMultipathNegotiation) { |
| 5576 // Test multipath negotiation during crypto handshake. Multipath is enabled |
| 5577 // when both endpoints enable multipath. |
| 5578 ValueRestore<bool> old_flag(&FLAGS_quic_enable_multipath, true); |
| 5579 EXPECT_TRUE(connection_.connected()); |
| 5580 EXPECT_FALSE(QuicConnectionPeer::IsMultipathEnabled(&connection_)); |
| 5581 EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _)); |
| 5582 QuicConfig config; |
| 5583 // Enable multipath on server side. |
| 5584 config.SetMultipathEnabled(true); |
| 5585 |
| 5586 // Create a handshake message enables multipath. |
| 5587 CryptoHandshakeMessage msg; |
| 5588 string error_details; |
| 5589 QuicConfig client_config; |
| 5590 // Enable multipath on client side. |
| 5591 client_config.SetMultipathEnabled(true); |
| 5592 client_config.ToHandshakeMessage(&msg); |
| 5593 const QuicErrorCode error = |
| 5594 config.ProcessPeerHello(msg, CLIENT, &error_details); |
| 5595 EXPECT_EQ(QUIC_NO_ERROR, error); |
| 5596 |
| 5597 connection_.SetFromConfig(config); |
| 5598 EXPECT_TRUE(QuicConnectionPeer::IsMultipathEnabled(&connection_)); |
| 5599 } |
| 5600 |
5575 } // namespace | 5601 } // namespace |
5576 } // namespace test | 5602 } // namespace test |
5577 } // namespace net | 5603 } // namespace net |
OLD | NEW |