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

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

Issue 1785713005: Use CopyOnWriteBuffer instead of Buffer to avoid unnecessary copies. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Feedback from tommi. 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
« no previous file with comments | « 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 2640 matching lines...) Expand 10 before | Expand all | Expand 10 after
2651 TEST_F(DataChannelTest, TestSendData) { 2651 TEST_F(DataChannelTest, TestSendData) {
2652 CreateChannels(0, 0); 2652 CreateChannels(0, 0);
2653 EXPECT_TRUE(SendInitiate()); 2653 EXPECT_TRUE(SendInitiate());
2654 EXPECT_TRUE(SendAccept()); 2654 EXPECT_TRUE(SendAccept());
2655 2655
2656 cricket::SendDataParams params; 2656 cricket::SendDataParams params;
2657 params.ssrc = 42; 2657 params.ssrc = 42;
2658 unsigned char data[] = { 2658 unsigned char data[] = {
2659 'f', 'o', 'o' 2659 'f', 'o', 'o'
2660 }; 2660 };
2661 rtc::Buffer payload(data, 3); 2661 rtc::CopyOnWriteBuffer payload(data, 3);
2662 cricket::SendDataResult result; 2662 cricket::SendDataResult result;
2663 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); 2663 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result));
2664 EXPECT_EQ(params.ssrc, 2664 EXPECT_EQ(params.ssrc,
2665 media_channel1_->last_sent_data_params().ssrc); 2665 media_channel1_->last_sent_data_params().ssrc);
2666 EXPECT_EQ("foo", media_channel1_->last_sent_data()); 2666 EXPECT_EQ("foo", media_channel1_->last_sent_data());
2667 } 2667 }
2668 2668
2669 // TODO(pthatcher): TestSetReceiver? 2669 // TODO(pthatcher): TestSetReceiver?
OLDNEW
« no previous file with comments | « webrtc/pc/channel.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698