| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 QuicClock clock_; | 279 QuicClock clock_; |
| 280 | 280 |
| 281 scoped_ptr<QuicSessionForTest> client_peer_; | 281 scoped_ptr<QuicSessionForTest> client_peer_; |
| 282 scoped_ptr<QuicSessionForTest> server_peer_; | 282 scoped_ptr<QuicSessionForTest> server_peer_; |
| 283 }; | 283 }; |
| 284 | 284 |
| 285 // Initializes "client peer" who begins crypto handshake and "server peer" who | 285 // Initializes "client peer" who begins crypto handshake and "server peer" who |
| 286 // establishes encryption with client. | 286 // establishes encryption with client. |
| 287 void QuicSessionTest::CreateClientAndServerSessions() { | 287 void QuicSessionTest::CreateClientAndServerSessions() { |
| 288 scoped_ptr<FakeTransportChannel> channel1( | 288 scoped_ptr<FakeTransportChannel> channel1( |
| 289 new FakeTransportChannel(nullptr, "channel1", 0)); | 289 new FakeTransportChannel("channel1", 0)); |
| 290 scoped_ptr<FakeTransportChannel> channel2( | 290 scoped_ptr<FakeTransportChannel> channel2( |
| 291 new FakeTransportChannel(nullptr, "channel2", 0)); | 291 new FakeTransportChannel("channel2", 0)); |
| 292 | 292 |
| 293 // Prevent channel1->OnReadPacket and channel2->OnReadPacket from calling | 293 // Prevent channel1->OnReadPacket and channel2->OnReadPacket from calling |
| 294 // themselves in a loop, which causes to future packets to be recursively | 294 // themselves in a loop, which causes to future packets to be recursively |
| 295 // consumed while the current thread blocks consumption of current ones. | 295 // consumed while the current thread blocks consumption of current ones. |
| 296 channel2->SetAsync(true); | 296 channel2->SetAsync(true); |
| 297 | 297 |
| 298 // Configure peers to send packets to each other. | 298 // Configure peers to send packets to each other. |
| 299 channel1->Connect(); | 299 channel1->Connect(); |
| 300 channel2->Connect(); | 300 channel2->Connect(); |
| 301 channel1->SetDestination(channel2.get()); | 301 channel1->SetDestination(channel2.get()); |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 StartHandshake(true, false); | 453 StartHandshake(true, false); |
| 454 TestDisconnectAfterFailedHandshake(); | 454 TestDisconnectAfterFailedHandshake(); |
| 455 } | 455 } |
| 456 | 456 |
| 457 // Test that data streams are not created before handshake. | 457 // Test that data streams are not created before handshake. |
| 458 TEST_F(QuicSessionTest, CannotCreateDataStreamBeforeHandshake) { | 458 TEST_F(QuicSessionTest, CannotCreateDataStreamBeforeHandshake) { |
| 459 CreateClientAndServerSessions(); | 459 CreateClientAndServerSessions(); |
| 460 EXPECT_EQ(nullptr, server_peer_->CreateOutgoingDynamicStream(5)); | 460 EXPECT_EQ(nullptr, server_peer_->CreateOutgoingDynamicStream(5)); |
| 461 EXPECT_EQ(nullptr, client_peer_->CreateOutgoingDynamicStream(5)); | 461 EXPECT_EQ(nullptr, client_peer_->CreateOutgoingDynamicStream(5)); |
| 462 } | 462 } |
| OLD | NEW |