Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Side by Side Diff: webrtc/p2p/quic/quicsession_unittest.cc

Issue 2089553002: Refactoring on QUIC (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Split the CL Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/api/quicdatatransport_unittest.cc ('k') | webrtc/p2p/quic/quictransportchannel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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();
300 channel1->SetDestination(channel2.get()); 298 channel1->SetDestination(channel2.get());
301 299
302 client_peer_ = CreateSession(std::move(channel1), Perspective::IS_CLIENT); 300 client_peer_ = CreateSession(std::move(channel1), Perspective::IS_CLIENT);
303 server_peer_ = CreateSession(std::move(channel2), Perspective::IS_SERVER); 301 server_peer_ = CreateSession(std::move(channel2), Perspective::IS_SERVER);
304 } 302 }
305 303
306 std::unique_ptr<QuicSessionForTest> QuicSessionTest::CreateSession( 304 std::unique_ptr<QuicSessionForTest> QuicSessionTest::CreateSession(
307 std::unique_ptr<FakeTransportChannel> channel, 305 std::unique_ptr<FakeTransportChannel> channel,
308 Perspective perspective) { 306 Perspective perspective) {
309 std::unique_ptr<QuicConnection> quic_connection = 307 std::unique_ptr<QuicConnection> quic_connection =
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 StartHandshake(true, true); 467 StartHandshake(true, true);
470 ASSERT_TRUE_WAIT(client_peer_->IsCryptoHandshakeConfirmed() && 468 ASSERT_TRUE_WAIT(client_peer_->IsCryptoHandshakeConfirmed() &&
471 server_peer_->IsCryptoHandshakeConfirmed(), 469 server_peer_->IsCryptoHandshakeConfirmed(),
472 kTimeoutMs); 470 kTimeoutMs);
473 ReliableQuicStream* stream = client_peer_->CreateOutgoingDynamicStream(5); 471 ReliableQuicStream* stream = client_peer_->CreateOutgoingDynamicStream(5);
474 ASSERT_NE(nullptr, stream); 472 ASSERT_NE(nullptr, stream);
475 EXPECT_FALSE(client_peer_->IsClosedStream(stream->id())); 473 EXPECT_FALSE(client_peer_->IsClosedStream(stream->id()));
476 stream->Close(); 474 stream->Close();
477 EXPECT_TRUE(client_peer_->IsClosedStream(stream->id())); 475 EXPECT_TRUE(client_peer_->IsClosedStream(stream->id()));
478 } 476 }
OLDNEW
« no previous file with comments | « webrtc/api/quicdatatransport_unittest.cc ('k') | webrtc/p2p/quic/quictransportchannel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698