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

Side by Side Diff: webrtc/api/peerconnectioninterface_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/api/objc/RTCDataChannel.mm ('k') | webrtc/api/sctputils.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 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 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 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after
1395 EXPECT_EQ(DataChannelInterface::kConnecting, data1->state()); 1395 EXPECT_EQ(DataChannelInterface::kConnecting, data1->state());
1396 EXPECT_EQ(DataChannelInterface::kConnecting, data2->state()); 1396 EXPECT_EQ(DataChannelInterface::kConnecting, data2->state());
1397 1397
1398 CreateOfferReceiveAnswer(); 1398 CreateOfferReceiveAnswer();
1399 EXPECT_TRUE_WAIT(observer1->IsOpen(), kTimeout); 1399 EXPECT_TRUE_WAIT(observer1->IsOpen(), kTimeout);
1400 EXPECT_TRUE_WAIT(observer2->IsOpen(), kTimeout); 1400 EXPECT_TRUE_WAIT(observer2->IsOpen(), kTimeout);
1401 1401
1402 EXPECT_EQ(DataChannelInterface::kOpen, data1->state()); 1402 EXPECT_EQ(DataChannelInterface::kOpen, data1->state());
1403 EXPECT_EQ(DataChannelInterface::kOpen, data2->state()); 1403 EXPECT_EQ(DataChannelInterface::kOpen, data2->state());
1404 1404
1405 rtc::Buffer buffer("test", 4); 1405 rtc::CopyOnWriteBuffer buffer("test", 4);
1406 EXPECT_FALSE(data1->Send(DataBuffer(buffer, true))); 1406 EXPECT_FALSE(data1->Send(DataBuffer(buffer, true)));
1407 } 1407 }
1408 1408
1409 // This test setup a RTP data channels in loop back and test that a channel is 1409 // This test setup a RTP data channels in loop back and test that a channel is
1410 // opened even if the remote end answer with a zero SSRC. 1410 // opened even if the remote end answer with a zero SSRC.
1411 TEST_F(PeerConnectionInterfaceTest, TestSendOnlyDataChannel) { 1411 TEST_F(PeerConnectionInterfaceTest, TestSendOnlyDataChannel) {
1412 FakeConstraints constraints; 1412 FakeConstraints constraints;
1413 constraints.SetAllowRtpDataChannels(); 1413 constraints.SetAllowRtpDataChannels();
1414 CreatePeerConnection(&constraints); 1414 CreatePeerConnection(&constraints);
1415 scoped_refptr<DataChannelInterface> data1 = 1415 scoped_refptr<DataChannelInterface> data1 =
(...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after
2607 FakeConstraints updated_answer_c; 2607 FakeConstraints updated_answer_c;
2608 answer_c.SetMandatoryReceiveAudio(false); 2608 answer_c.SetMandatoryReceiveAudio(false);
2609 answer_c.SetMandatoryReceiveVideo(false); 2609 answer_c.SetMandatoryReceiveVideo(false);
2610 2610
2611 cricket::MediaSessionOptions updated_answer_options; 2611 cricket::MediaSessionOptions updated_answer_options;
2612 EXPECT_TRUE( 2612 EXPECT_TRUE(
2613 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options)); 2613 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options));
2614 EXPECT_TRUE(updated_answer_options.has_audio()); 2614 EXPECT_TRUE(updated_answer_options.has_audio());
2615 EXPECT_TRUE(updated_answer_options.has_video()); 2615 EXPECT_TRUE(updated_answer_options.has_video());
2616 } 2616 }
OLDNEW
« no previous file with comments | « webrtc/api/objc/RTCDataChannel.mm ('k') | webrtc/api/sctputils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698