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

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

Issue 1691673002: Remove GetTransport() from TransportChannelImpl (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Restore deleted P2PTransportChannel constructor (and mark deprecated) to not break Chromium Created 4 years, 10 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/p2p/base/transportchannelimpl.h ('k') | no next file » | 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « webrtc/p2p/base/transportchannelimpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698