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

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

Issue 1871993002: Only generate one CNAME per PeerConnection. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Move GenerateCname() to PeerConnect Created 4 years, 8 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/pc/mediasession.h ('K') | « webrtc/pc/mediasession.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 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2004 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 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after
1299 EXPECT_EQ(audio_streams[0], updated_audio_streams[0]); 1299 EXPECT_EQ(audio_streams[0], updated_audio_streams[0]);
1300 EXPECT_EQ(kAudioTrack3, updated_audio_streams[1].id); // New audio track. 1300 EXPECT_EQ(kAudioTrack3, updated_audio_streams[1].id); // New audio track.
1301 ASSERT_EQ(1U, updated_audio_streams[1].ssrcs.size()); 1301 ASSERT_EQ(1U, updated_audio_streams[1].ssrcs.size());
1302 EXPECT_NE(0U, updated_audio_streams[1].ssrcs[0]); 1302 EXPECT_NE(0U, updated_audio_streams[1].ssrcs[0]);
1303 EXPECT_EQ(updated_audio_streams[0].cname, updated_audio_streams[1].cname); 1303 EXPECT_EQ(updated_audio_streams[0].cname, updated_audio_streams[1].cname);
1304 1304
1305 const StreamParamsVec& updated_video_streams = updated_vcd->streams(); 1305 const StreamParamsVec& updated_video_streams = updated_vcd->streams();
1306 ASSERT_EQ(2U, updated_video_streams.size()); 1306 ASSERT_EQ(2U, updated_video_streams.size());
1307 EXPECT_EQ(video_streams[0], updated_video_streams[0]); 1307 EXPECT_EQ(video_streams[0], updated_video_streams[0]);
1308 EXPECT_EQ(kVideoTrack2, updated_video_streams[1].id); 1308 EXPECT_EQ(kVideoTrack2, updated_video_streams[1].id);
1309 EXPECT_NE(updated_video_streams[1].cname, updated_video_streams[0].cname); 1309 // All the media streams in one PeerConnection share one cname
Taylor Brandstetter 2016/04/13 23:03:06 nit: Period at end of comment (the other one below
1310 EXPECT_EQ(updated_video_streams[1].cname, updated_video_streams[0].cname);
1310 1311
1311 const StreamParamsVec& updated_data_streams = updated_dcd->streams(); 1312 const StreamParamsVec& updated_data_streams = updated_dcd->streams();
1312 ASSERT_EQ(2U, updated_data_streams.size()); 1313 ASSERT_EQ(2U, updated_data_streams.size());
1313 EXPECT_EQ(data_streams[0], updated_data_streams[0]); 1314 EXPECT_EQ(data_streams[0], updated_data_streams[0]);
1314 EXPECT_EQ(kDataTrack3, updated_data_streams[1].id); // New data track. 1315 EXPECT_EQ(kDataTrack3, updated_data_streams[1].id); // New data track.
1315 ASSERT_EQ(1U, updated_data_streams[1].ssrcs.size()); 1316 ASSERT_EQ(1U, updated_data_streams[1].ssrcs.size());
1316 EXPECT_NE(0U, updated_data_streams[1].ssrcs[0]); 1317 EXPECT_NE(0U, updated_data_streams[1].ssrcs[0]);
1317 EXPECT_EQ(updated_data_streams[0].cname, updated_data_streams[1].cname); 1318 EXPECT_EQ(updated_data_streams[0].cname, updated_data_streams[1].cname);
1318 } 1319 }
1319 1320
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
1418 EXPECT_NE(0U, data_streams[0].ssrcs[0]); 1419 EXPECT_NE(0U, data_streams[0].ssrcs[0]);
1419 EXPECT_EQ(kDataTrack2, data_streams[1].id); 1420 EXPECT_EQ(kDataTrack2, data_streams[1].id);
1420 ASSERT_EQ(1U, data_streams[1].ssrcs.size()); 1421 ASSERT_EQ(1U, data_streams[1].ssrcs.size());
1421 EXPECT_NE(0U, data_streams[1].ssrcs[0]); 1422 EXPECT_NE(0U, data_streams[1].ssrcs[0]);
1422 1423
1423 EXPECT_EQ(cricket::kDataMaxBandwidth, 1424 EXPECT_EQ(cricket::kDataMaxBandwidth,
1424 dcd->bandwidth()); // default bandwidth (auto) 1425 dcd->bandwidth()); // default bandwidth (auto)
1425 EXPECT_TRUE(dcd->rtcp_mux()); // rtcp-mux defaults on 1426 EXPECT_TRUE(dcd->rtcp_mux()); // rtcp-mux defaults on
1426 1427
1427 // Update the answer. Add a new video track that is not synched to the 1428 // Update the answer. Add a new video track that is not synched to the
1428 // other traacks and remove 1 audio track. 1429 // other tracks and remove 1 audio track.
1429 opts.AddSendStream(MEDIA_TYPE_VIDEO, kVideoTrack2, kMediaStream2); 1430 opts.AddSendStream(MEDIA_TYPE_VIDEO, kVideoTrack2, kMediaStream2);
1430 opts.RemoveSendStream(MEDIA_TYPE_AUDIO, kAudioTrack2); 1431 opts.RemoveSendStream(MEDIA_TYPE_AUDIO, kAudioTrack2);
1431 opts.RemoveSendStream(MEDIA_TYPE_DATA, kDataTrack2); 1432 opts.RemoveSendStream(MEDIA_TYPE_DATA, kDataTrack2);
1432 std::unique_ptr<SessionDescription> updated_answer( 1433 std::unique_ptr<SessionDescription> updated_answer(
1433 f2_.CreateAnswer(offer.get(), opts, answer.get())); 1434 f2_.CreateAnswer(offer.get(), opts, answer.get()));
1434 1435
1435 ASSERT_TRUE(updated_answer.get() != NULL); 1436 ASSERT_TRUE(updated_answer.get() != NULL);
1436 ac = updated_answer->GetContentByName("audio"); 1437 ac = updated_answer->GetContentByName("audio");
1437 vc = updated_answer->GetContentByName("video"); 1438 vc = updated_answer->GetContentByName("video");
1438 dc = updated_answer->GetContentByName("data"); 1439 dc = updated_answer->GetContentByName("data");
(...skipping 22 matching lines...) Expand all
1461 EXPECT_EQ(dcd->codecs(), updated_dcd->codecs()); 1462 EXPECT_EQ(dcd->codecs(), updated_dcd->codecs());
1462 1463
1463 const StreamParamsVec& updated_audio_streams = updated_acd->streams(); 1464 const StreamParamsVec& updated_audio_streams = updated_acd->streams();
1464 ASSERT_EQ(1U, updated_audio_streams.size()); 1465 ASSERT_EQ(1U, updated_audio_streams.size());
1465 EXPECT_TRUE(audio_streams[0] == updated_audio_streams[0]); 1466 EXPECT_TRUE(audio_streams[0] == updated_audio_streams[0]);
1466 1467
1467 const StreamParamsVec& updated_video_streams = updated_vcd->streams(); 1468 const StreamParamsVec& updated_video_streams = updated_vcd->streams();
1468 ASSERT_EQ(2U, updated_video_streams.size()); 1469 ASSERT_EQ(2U, updated_video_streams.size());
1469 EXPECT_EQ(video_streams[0], updated_video_streams[0]); 1470 EXPECT_EQ(video_streams[0], updated_video_streams[0]);
1470 EXPECT_EQ(kVideoTrack2, updated_video_streams[1].id); 1471 EXPECT_EQ(kVideoTrack2, updated_video_streams[1].id);
1471 EXPECT_NE(updated_video_streams[1].cname, updated_video_streams[0].cname); 1472 // All media streams in one PeerConnection share one cname
1473 EXPECT_EQ(updated_video_streams[1].cname, updated_video_streams[0].cname);
1472 1474
1473 const StreamParamsVec& updated_data_streams = updated_dcd->streams(); 1475 const StreamParamsVec& updated_data_streams = updated_dcd->streams();
1474 ASSERT_EQ(1U, updated_data_streams.size()); 1476 ASSERT_EQ(1U, updated_data_streams.size());
1475 EXPECT_TRUE(data_streams[0] == updated_data_streams[0]); 1477 EXPECT_TRUE(data_streams[0] == updated_data_streams[0]);
1476 } 1478 }
1477 1479
1478 1480
1479 // Create an updated offer after creating an answer to the original offer and 1481 // Create an updated offer after creating an answer to the original offer and
1480 // verify that the codecs that were part of the original answer are not changed 1482 // verify that the codecs that were part of the original answer are not changed
1481 // in the updated offer. 1483 // in the updated offer.
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after
2372 const ContentInfo* audio_content = GetFirstAudioContent(updated_offer.get()); 2374 const ContentInfo* audio_content = GetFirstAudioContent(updated_offer.get());
2373 const ContentInfo* video_content = GetFirstVideoContent(updated_offer.get()); 2375 const ContentInfo* video_content = GetFirstVideoContent(updated_offer.get());
2374 const ContentInfo* data_content = GetFirstDataContent(updated_offer.get()); 2376 const ContentInfo* data_content = GetFirstDataContent(updated_offer.get());
2375 ASSERT_TRUE(audio_content != nullptr); 2377 ASSERT_TRUE(audio_content != nullptr);
2376 ASSERT_TRUE(video_content != nullptr); 2378 ASSERT_TRUE(video_content != nullptr);
2377 ASSERT_TRUE(data_content != nullptr); 2379 ASSERT_TRUE(data_content != nullptr);
2378 EXPECT_EQ("audio_modified", audio_content->name); 2380 EXPECT_EQ("audio_modified", audio_content->name);
2379 EXPECT_EQ("video_modified", video_content->name); 2381 EXPECT_EQ("video_modified", video_content->name);
2380 EXPECT_EQ("data_modified", data_content->name); 2382 EXPECT_EQ("data_modified", data_content->name);
2381 } 2383 }
OLDNEW
« webrtc/pc/mediasession.h ('K') | « webrtc/pc/mediasession.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698