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

Side by Side Diff: webrtc/api/quicdatachannel_unittest.cc

Issue 2146133002: Revert of Modify PeerConnection for end-to-end QuicDataChannel usage (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: 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/quicdatachannel.cc ('k') | webrtc/api/quicdatatransport.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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 this, &FakeQuicDataTransport::OnIncomingStream); 113 this, &FakeQuicDataTransport::OnIncomingStream);
114 } 114 }
115 115
116 rtc::scoped_refptr<QuicDataChannel> CreateDataChannel( 116 rtc::scoped_refptr<QuicDataChannel> CreateDataChannel(
117 int id, 117 int id,
118 const std::string& label, 118 const std::string& label,
119 const std::string& protocol) { 119 const std::string& protocol) {
120 DataChannelInit config; 120 DataChannelInit config;
121 config.id = id; 121 config.id = id;
122 config.protocol = protocol; 122 config.protocol = protocol;
123 rtc::scoped_refptr<QuicDataChannel> data_channel( 123 rtc::scoped_refptr<QuicDataChannel> data_channel(new QuicDataChannel(
124 new QuicDataChannel(rtc::Thread::Current(), rtc::Thread::Current(), 124 rtc::Thread::Current(), rtc::Thread::Current(), label, config));
125 rtc::Thread::Current(), label, config));
126 data_channel_by_id_[id] = data_channel; 125 data_channel_by_id_[id] = data_channel;
127 return data_channel; 126 return data_channel;
128 } 127 }
129 128
130 private: 129 private:
131 void OnIncomingStream(cricket::ReliableQuicStream* stream) { 130 void OnIncomingStream(cricket::ReliableQuicStream* stream) {
132 incoming_stream_ = stream; 131 incoming_stream_ = stream;
133 incoming_stream_->SignalDataReceived.connect( 132 incoming_stream_->SignalDataReceived.connect(
134 this, &FakeQuicDataTransport::OnDataReceived); 133 this, &FakeQuicDataTransport::OnDataReceived);
135 } 134 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 194
196 rtc::scoped_refptr<QuicDataChannel> CreateDataChannelWithoutTransportChannel( 195 rtc::scoped_refptr<QuicDataChannel> CreateDataChannelWithoutTransportChannel(
197 int id, 196 int id,
198 const std::string& label, 197 const std::string& label,
199 const std::string& protocol) { 198 const std::string& protocol) {
200 return fake_quic_data_transport_.CreateDataChannel(id, label, protocol); 199 return fake_quic_data_transport_.CreateDataChannel(id, label, protocol);
201 } 200 }
202 201
203 // Connects |ice_transport_channel_| to that of the other peer. 202 // Connects |ice_transport_channel_| to that of the other peer.
204 void Connect(QuicDataChannelPeer* other_peer) { 203 void Connect(QuicDataChannelPeer* other_peer) {
204 ice_transport_channel_->Connect();
205 other_peer->ice_transport_channel_->Connect();
205 ice_transport_channel_->SetDestination(other_peer->ice_transport_channel_); 206 ice_transport_channel_->SetDestination(other_peer->ice_transport_channel_);
206 } 207 }
207 208
208 std::unique_ptr<rtc::SSLFingerprint>& local_fingerprint() { 209 std::unique_ptr<rtc::SSLFingerprint>& local_fingerprint() {
209 return local_fingerprint_; 210 return local_fingerprint_;
210 } 211 }
211 212
212 QuicTransportChannel* quic_transport_channel() { 213 QuicTransportChannel* quic_transport_channel() {
213 return &quic_transport_channel_; 214 return &quic_transport_channel_;
214 } 215 }
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 size_t bytes_read2; 650 size_t bytes_read2;
650 ASSERT_TRUE(webrtc::ParseQuicDataMessageHeader( 651 ASSERT_TRUE(webrtc::ParseQuicDataMessageHeader(
651 header2.data<char>(), header2.size(), &decoded_data_channel_id2, 652 header2.data<char>(), header2.size(), &decoded_data_channel_id2,
652 &decoded_message_id2, &bytes_read2)); 653 &decoded_message_id2, &bytes_read2));
653 EXPECT_EQ(data_channel_id2, decoded_data_channel_id2); 654 EXPECT_EQ(data_channel_id2, decoded_data_channel_id2);
654 EXPECT_EQ(message_id2, decoded_message_id2); 655 EXPECT_EQ(message_id2, decoded_message_id2);
655 EXPECT_EQ(8u, bytes_read2); 656 EXPECT_EQ(8u, bytes_read2);
656 } 657 }
657 658
658 } // namespace 659 } // namespace
OLDNEW
« no previous file with comments | « webrtc/api/quicdatachannel.cc ('k') | webrtc/api/quicdatatransport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698