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

Side by Side Diff: webrtc/pc/channel_unittest.cc

Issue 1823503002: Reland Use CopyOnWriteBuffer instead of Buffer to avoid unnecessary copies. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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
« webrtc/media/sctp/sctpdataengine.cc ('K') | « webrtc/pc/channel.cc ('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 2009 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2009 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 2751 matching lines...) Expand 10 before | Expand all | Expand 10 after
2762 TEST_F(DataChannelTest, TestSendData) { 2762 TEST_F(DataChannelTest, TestSendData) {
2763 CreateChannels(0, 0); 2763 CreateChannels(0, 0);
2764 EXPECT_TRUE(SendInitiate()); 2764 EXPECT_TRUE(SendInitiate());
2765 EXPECT_TRUE(SendAccept()); 2765 EXPECT_TRUE(SendAccept());
2766 2766
2767 cricket::SendDataParams params; 2767 cricket::SendDataParams params;
2768 params.ssrc = 42; 2768 params.ssrc = 42;
2769 unsigned char data[] = { 2769 unsigned char data[] = {
2770 'f', 'o', 'o' 2770 'f', 'o', 'o'
2771 }; 2771 };
2772 rtc::Buffer payload(data, 3); 2772 rtc::CopyOnWriteBuffer payload(data, 3);
2773 cricket::SendDataResult result; 2773 cricket::SendDataResult result;
2774 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); 2774 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result));
2775 EXPECT_EQ(params.ssrc, 2775 EXPECT_EQ(params.ssrc,
2776 media_channel1_->last_sent_data_params().ssrc); 2776 media_channel1_->last_sent_data_params().ssrc);
2777 EXPECT_EQ("foo", media_channel1_->last_sent_data()); 2777 EXPECT_EQ("foo", media_channel1_->last_sent_data());
2778 } 2778 }
2779 2779
2780 // TODO(pthatcher): TestSetReceiver? 2780 // TODO(pthatcher): TestSetReceiver?
OLDNEW
« webrtc/media/sctp/sctpdataengine.cc ('K') | « webrtc/pc/channel.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698