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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 new FakeTransportChannel("channel1", 0)); | 288 new FakeTransportChannel("channel1", 0)); |
289 std::unique_ptr<FakeTransportChannel> channel2( | 289 std::unique_ptr<FakeTransportChannel> channel2( |
290 new FakeTransportChannel("channel2", 0)); | 290 new FakeTransportChannel("channel2", 0)); |
291 | 291 |
292 // Prevent channel1->OnReadPacket and channel2->OnReadPacket from calling | 292 // Prevent channel1->OnReadPacket and channel2->OnReadPacket from calling |
293 // themselves in a loop, which causes to future packets to be recursively | 293 // themselves in a loop, which causes to future packets to be recursively |
294 // consumed while the current thread blocks consumption of current ones. | 294 // consumed while the current thread blocks consumption of current ones. |
295 channel2->SetAsync(true); | 295 channel2->SetAsync(true); |
296 | 296 |
297 // Configure peers to send packets to each other. | 297 // Configure peers to send packets to each other. |
| 298 channel1->Connect(); |
| 299 channel2->Connect(); |
298 channel1->SetDestination(channel2.get()); | 300 channel1->SetDestination(channel2.get()); |
299 | 301 |
300 client_peer_ = CreateSession(std::move(channel1), Perspective::IS_CLIENT); | 302 client_peer_ = CreateSession(std::move(channel1), Perspective::IS_CLIENT); |
301 server_peer_ = CreateSession(std::move(channel2), Perspective::IS_SERVER); | 303 server_peer_ = CreateSession(std::move(channel2), Perspective::IS_SERVER); |
302 } | 304 } |
303 | 305 |
304 std::unique_ptr<QuicSessionForTest> QuicSessionTest::CreateSession( | 306 std::unique_ptr<QuicSessionForTest> QuicSessionTest::CreateSession( |
305 std::unique_ptr<FakeTransportChannel> channel, | 307 std::unique_ptr<FakeTransportChannel> channel, |
306 Perspective perspective) { | 308 Perspective perspective) { |
307 std::unique_ptr<QuicConnection> quic_connection = | 309 std::unique_ptr<QuicConnection> quic_connection = |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 StartHandshake(true, true); | 469 StartHandshake(true, true); |
468 ASSERT_TRUE_WAIT(client_peer_->IsCryptoHandshakeConfirmed() && | 470 ASSERT_TRUE_WAIT(client_peer_->IsCryptoHandshakeConfirmed() && |
469 server_peer_->IsCryptoHandshakeConfirmed(), | 471 server_peer_->IsCryptoHandshakeConfirmed(), |
470 kTimeoutMs); | 472 kTimeoutMs); |
471 ReliableQuicStream* stream = client_peer_->CreateOutgoingDynamicStream(5); | 473 ReliableQuicStream* stream = client_peer_->CreateOutgoingDynamicStream(5); |
472 ASSERT_NE(nullptr, stream); | 474 ASSERT_NE(nullptr, stream); |
473 EXPECT_FALSE(client_peer_->IsClosedStream(stream->id())); | 475 EXPECT_FALSE(client_peer_->IsClosedStream(stream->id())); |
474 stream->Close(); | 476 stream->Close(); |
475 EXPECT_TRUE(client_peer_->IsClosedStream(stream->id())); | 477 EXPECT_TRUE(client_peer_->IsClosedStream(stream->id())); |
476 } | 478 } |
OLD | NEW |