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

Side by Side Diff: webrtc/api/quicdatatransport_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.cc ('k') | webrtc/p2p/quic/quicsession_unittest.cc » ('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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 private: 58 private:
59 std::vector<std::string> messages_; 59 std::vector<std::string> messages_;
60 }; 60 };
61 61
62 // A peer who uses a QUIC transport channel and fake ICE transport channel to 62 // A peer who uses a QUIC transport channel and fake ICE transport channel to
63 // send or receive data. 63 // send or receive data.
64 class QuicDataTransportPeer { 64 class QuicDataTransportPeer {
65 public: 65 public:
66 QuicDataTransportPeer() 66 QuicDataTransportPeer()
67 : quic_data_transport_(rtc::Thread::Current(), rtc::Thread::Current()), 67 : quic_data_transport_(rtc::Thread::Current(),
68 rtc::Thread::Current(),
69 rtc::Thread::Current()),
68 ice_transport_channel_(new FakeTransportChannel("data", 0)), 70 ice_transport_channel_(new FakeTransportChannel("data", 0)),
69 quic_transport_channel_(ice_transport_channel_) { 71 quic_transport_channel_(ice_transport_channel_) {
70 ice_transport_channel_->SetAsync(true); 72 ice_transport_channel_->SetAsync(true);
71 } 73 }
72 74
73 void GenerateCertificateAndFingerprint() { 75 void GenerateCertificateAndFingerprint() {
74 rtc::scoped_refptr<rtc::RTCCertificate> local_cert = 76 rtc::scoped_refptr<rtc::RTCCertificate> local_cert =
75 rtc::RTCCertificate::Create(std::unique_ptr<rtc::SSLIdentity>( 77 rtc::RTCCertificate::Create(std::unique_ptr<rtc::SSLIdentity>(
76 rtc::SSLIdentity::Generate("cert_name", rtc::KT_DEFAULT))); 78 rtc::SSLIdentity::Generate("cert_name", rtc::KT_DEFAULT)));
77 quic_transport_channel_.SetLocalCertificate(local_cert); 79 quic_transport_channel_.SetLocalCertificate(local_cert);
78 local_fingerprint_.reset(CreateFingerprint(local_cert.get())); 80 local_fingerprint_.reset(CreateFingerprint(local_cert.get()));
79 } 81 }
80 82
81 // Connects |ice_transport_channel_| to that of the other peer. 83 // Connects |ice_transport_channel_| to that of the other peer.
82 void Connect(QuicDataTransportPeer* other_peer) { 84 void Connect(QuicDataTransportPeer* other_peer) {
83 ice_transport_channel_->Connect();
84 other_peer->ice_transport_channel_->Connect();
85 ice_transport_channel_->SetDestination(other_peer->ice_transport_channel_); 85 ice_transport_channel_->SetDestination(other_peer->ice_transport_channel_);
86 } 86 }
87 87
88 std::unique_ptr<rtc::SSLFingerprint>& local_fingerprint() { 88 std::unique_ptr<rtc::SSLFingerprint>& local_fingerprint() {
89 return local_fingerprint_; 89 return local_fingerprint_;
90 } 90 }
91 91
92 QuicTransportChannel* quic_transport_channel() { 92 QuicTransportChannel* quic_transport_channel() {
93 return &quic_transport_channel_; 93 return &quic_transport_channel_;
94 } 94 }
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 QuicTransportChannel* transport_channel = peer1_.quic_transport_channel(); 347 QuicTransportChannel* transport_channel = peer1_.quic_transport_channel();
348 EXPECT_TRUE(quic_data_transport->SetTransportChannel(transport_channel)); 348 EXPECT_TRUE(quic_data_transport->SetTransportChannel(transport_channel));
349 EXPECT_TRUE(quic_data_transport->SetTransportChannel(transport_channel)); 349 EXPECT_TRUE(quic_data_transport->SetTransportChannel(transport_channel));
350 QuicTransportChannel* other_transport_channel = 350 QuicTransportChannel* other_transport_channel =
351 peer2_.quic_transport_channel(); 351 peer2_.quic_transport_channel();
352 EXPECT_FALSE( 352 EXPECT_FALSE(
353 quic_data_transport->SetTransportChannel(other_transport_channel)); 353 quic_data_transport->SetTransportChannel(other_transport_channel));
354 } 354 }
355 355
356 } // namespace 356 } // namespace
OLDNEW
« no previous file with comments | « webrtc/api/quicdatatransport.cc ('k') | webrtc/p2p/quic/quicsession_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698