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

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

Issue 2089553002: Refactoring on QUIC (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Disable quic for review. Created 4 years, 6 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
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(new QuicDataChannel( 123 rtc::scoped_refptr<QuicDataChannel> data_channel(
124 rtc::Thread::Current(), rtc::Thread::Current(), label, config)); 124 new QuicDataChannel(rtc::Thread::Current(), rtc::Thread::Current(),
125 rtc::Thread::Current(), label, config));
125 data_channel_by_id_[id] = data_channel; 126 data_channel_by_id_[id] = data_channel;
126 return data_channel; 127 return data_channel;
127 } 128 }
128 129
129 private: 130 private:
130 void OnIncomingStream(cricket::ReliableQuicStream* stream) { 131 void OnIncomingStream(cricket::ReliableQuicStream* stream) {
131 incoming_stream_ = stream; 132 incoming_stream_ = stream;
132 incoming_stream_->SignalDataReceived.connect( 133 incoming_stream_->SignalDataReceived.connect(
133 this, &FakeQuicDataTransport::OnDataReceived); 134 this, &FakeQuicDataTransport::OnDataReceived);
134 } 135 }
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 size_t bytes_read2; 651 size_t bytes_read2;
651 ASSERT_TRUE(webrtc::ParseQuicDataMessageHeader( 652 ASSERT_TRUE(webrtc::ParseQuicDataMessageHeader(
652 header2.data<char>(), header2.size(), &decoded_data_channel_id2, 653 header2.data<char>(), header2.size(), &decoded_data_channel_id2,
653 &decoded_message_id2, &bytes_read2)); 654 &decoded_message_id2, &bytes_read2));
654 EXPECT_EQ(data_channel_id2, decoded_data_channel_id2); 655 EXPECT_EQ(data_channel_id2, decoded_data_channel_id2);
655 EXPECT_EQ(message_id2, decoded_message_id2); 656 EXPECT_EQ(message_id2, decoded_message_id2);
656 EXPECT_EQ(8u, bytes_read2); 657 EXPECT_EQ(8u, bytes_read2);
657 } 658 }
658 659
659 } // namespace 660 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698