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

Side by Side Diff: webrtc/api/peerconnectioninterface_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
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 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after
1393 EXPECT_EQ(DataChannelInterface::kConnecting, data1->state()); 1393 EXPECT_EQ(DataChannelInterface::kConnecting, data1->state());
1394 EXPECT_EQ(DataChannelInterface::kConnecting, data2->state()); 1394 EXPECT_EQ(DataChannelInterface::kConnecting, data2->state());
1395 1395
1396 CreateOfferReceiveAnswer(); 1396 CreateOfferReceiveAnswer();
1397 EXPECT_TRUE_WAIT(observer1->IsOpen(), kTimeout); 1397 EXPECT_TRUE_WAIT(observer1->IsOpen(), kTimeout);
1398 EXPECT_TRUE_WAIT(observer2->IsOpen(), kTimeout); 1398 EXPECT_TRUE_WAIT(observer2->IsOpen(), kTimeout);
1399 1399
1400 EXPECT_EQ(DataChannelInterface::kOpen, data1->state()); 1400 EXPECT_EQ(DataChannelInterface::kOpen, data1->state());
1401 EXPECT_EQ(DataChannelInterface::kOpen, data2->state()); 1401 EXPECT_EQ(DataChannelInterface::kOpen, data2->state());
1402 1402
1403 rtc::Buffer buffer("test", 4); 1403 rtc::CopyOnWriteBuffer buffer("test", 4);
1404 EXPECT_FALSE(data1->Send(DataBuffer(buffer, true))); 1404 EXPECT_FALSE(data1->Send(DataBuffer(buffer, true)));
1405 } 1405 }
1406 1406
1407 // This test setup a RTP data channels in loop back and test that a channel is 1407 // This test setup a RTP data channels in loop back and test that a channel is
1408 // opened even if the remote end answer with a zero SSRC. 1408 // opened even if the remote end answer with a zero SSRC.
1409 TEST_F(PeerConnectionInterfaceTest, TestSendOnlyDataChannel) { 1409 TEST_F(PeerConnectionInterfaceTest, TestSendOnlyDataChannel) {
1410 FakeConstraints constraints; 1410 FakeConstraints constraints;
1411 constraints.SetAllowRtpDataChannels(); 1411 constraints.SetAllowRtpDataChannels();
1412 CreatePeerConnection(&constraints); 1412 CreatePeerConnection(&constraints);
1413 scoped_refptr<DataChannelInterface> data1 = 1413 scoped_refptr<DataChannelInterface> data1 =
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after
2683 FakeConstraints updated_answer_c; 2683 FakeConstraints updated_answer_c;
2684 answer_c.SetMandatoryReceiveAudio(false); 2684 answer_c.SetMandatoryReceiveAudio(false);
2685 answer_c.SetMandatoryReceiveVideo(false); 2685 answer_c.SetMandatoryReceiveVideo(false);
2686 2686
2687 cricket::MediaSessionOptions updated_answer_options; 2687 cricket::MediaSessionOptions updated_answer_options;
2688 EXPECT_TRUE( 2688 EXPECT_TRUE(
2689 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options)); 2689 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options));
2690 EXPECT_TRUE(updated_answer_options.has_audio()); 2690 EXPECT_TRUE(updated_answer_options.has_audio());
2691 EXPECT_TRUE(updated_answer_options.has_video()); 2691 EXPECT_TRUE(updated_answer_options.has_video());
2692 } 2692 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698