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

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: 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.cc ('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 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after
1309 EXPECT_EQ(audio_streams[0], updated_audio_streams[0]); 1309 EXPECT_EQ(audio_streams[0], updated_audio_streams[0]);
1310 EXPECT_EQ(kAudioTrack3, updated_audio_streams[1].id); // New audio track. 1310 EXPECT_EQ(kAudioTrack3, updated_audio_streams[1].id); // New audio track.
1311 ASSERT_EQ(1U, updated_audio_streams[1].ssrcs.size()); 1311 ASSERT_EQ(1U, updated_audio_streams[1].ssrcs.size());
1312 EXPECT_NE(0U, updated_audio_streams[1].ssrcs[0]); 1312 EXPECT_NE(0U, updated_audio_streams[1].ssrcs[0]);
1313 EXPECT_EQ(updated_audio_streams[0].cname, updated_audio_streams[1].cname); 1313 EXPECT_EQ(updated_audio_streams[0].cname, updated_audio_streams[1].cname);
1314 1314
1315 const StreamParamsVec& updated_video_streams = updated_vcd->streams(); 1315 const StreamParamsVec& updated_video_streams = updated_vcd->streams();
1316 ASSERT_EQ(2U, updated_video_streams.size()); 1316 ASSERT_EQ(2U, updated_video_streams.size());
1317 EXPECT_EQ(video_streams[0], updated_video_streams[0]); 1317 EXPECT_EQ(video_streams[0], updated_video_streams[0]);
1318 EXPECT_EQ(kVideoTrack2, updated_video_streams[1].id); 1318 EXPECT_EQ(kVideoTrack2, updated_video_streams[1].id);
1319 EXPECT_NE(updated_video_streams[1].cname, updated_video_streams[0].cname); 1319 // All the media streams in one PeerConnection share one cname
1320 EXPECT_EQ(updated_video_streams[1].cname, updated_video_streams[0].cname);
1320 1321
1321 const StreamParamsVec& updated_data_streams = updated_dcd->streams(); 1322 const StreamParamsVec& updated_data_streams = updated_dcd->streams();
1322 ASSERT_EQ(2U, updated_data_streams.size()); 1323 ASSERT_EQ(2U, updated_data_streams.size());
1323 EXPECT_EQ(data_streams[0], updated_data_streams[0]); 1324 EXPECT_EQ(data_streams[0], updated_data_streams[0]);
1324 EXPECT_EQ(kDataTrack3, updated_data_streams[1].id); // New data track. 1325 EXPECT_EQ(kDataTrack3, updated_data_streams[1].id); // New data track.
1325 ASSERT_EQ(1U, updated_data_streams[1].ssrcs.size()); 1326 ASSERT_EQ(1U, updated_data_streams[1].ssrcs.size());
1326 EXPECT_NE(0U, updated_data_streams[1].ssrcs[0]); 1327 EXPECT_NE(0U, updated_data_streams[1].ssrcs[0]);
1327 EXPECT_EQ(updated_data_streams[0].cname, updated_data_streams[1].cname); 1328 EXPECT_EQ(updated_data_streams[0].cname, updated_data_streams[1].cname);
1328 } 1329 }
1329 1330
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 EXPECT_NE(0U, data_streams[0].ssrcs[0]); 1429 EXPECT_NE(0U, data_streams[0].ssrcs[0]);
1429 EXPECT_EQ(kDataTrack2, data_streams[1].id); 1430 EXPECT_EQ(kDataTrack2, data_streams[1].id);
1430 ASSERT_EQ(1U, data_streams[1].ssrcs.size()); 1431 ASSERT_EQ(1U, data_streams[1].ssrcs.size());
1431 EXPECT_NE(0U, data_streams[1].ssrcs[0]); 1432 EXPECT_NE(0U, data_streams[1].ssrcs[0]);
1432 1433
1433 EXPECT_EQ(cricket::kDataMaxBandwidth, 1434 EXPECT_EQ(cricket::kDataMaxBandwidth,
1434 dcd->bandwidth()); // default bandwidth (auto) 1435 dcd->bandwidth()); // default bandwidth (auto)
1435 EXPECT_TRUE(dcd->rtcp_mux()); // rtcp-mux defaults on 1436 EXPECT_TRUE(dcd->rtcp_mux()); // rtcp-mux defaults on
1436 1437
1437 // Update the answer. Add a new video track that is not synched to the 1438 // Update the answer. Add a new video track that is not synched to the
1438 // other traacks and remove 1 audio track. 1439 // other tracks and remove 1 audio track.
1439 opts.AddSendStream(MEDIA_TYPE_VIDEO, kVideoTrack2, kMediaStream2); 1440 opts.AddSendStream(MEDIA_TYPE_VIDEO, kVideoTrack2, kMediaStream2);
1440 opts.RemoveSendStream(MEDIA_TYPE_AUDIO, kAudioTrack2); 1441 opts.RemoveSendStream(MEDIA_TYPE_AUDIO, kAudioTrack2);
1441 opts.RemoveSendStream(MEDIA_TYPE_DATA, kDataTrack2); 1442 opts.RemoveSendStream(MEDIA_TYPE_DATA, kDataTrack2);
1442 std::unique_ptr<SessionDescription> updated_answer( 1443 std::unique_ptr<SessionDescription> updated_answer(
1443 f2_.CreateAnswer(offer.get(), opts, answer.get())); 1444 f2_.CreateAnswer(offer.get(), opts, answer.get()));
1444 1445
1445 ASSERT_TRUE(updated_answer.get() != NULL); 1446 ASSERT_TRUE(updated_answer.get() != NULL);
1446 ac = updated_answer->GetContentByName("audio"); 1447 ac = updated_answer->GetContentByName("audio");
1447 vc = updated_answer->GetContentByName("video"); 1448 vc = updated_answer->GetContentByName("video");
1448 dc = updated_answer->GetContentByName("data"); 1449 dc = updated_answer->GetContentByName("data");
(...skipping 22 matching lines...) Expand all
1471 EXPECT_EQ(dcd->codecs(), updated_dcd->codecs()); 1472 EXPECT_EQ(dcd->codecs(), updated_dcd->codecs());
1472 1473
1473 const StreamParamsVec& updated_audio_streams = updated_acd->streams(); 1474 const StreamParamsVec& updated_audio_streams = updated_acd->streams();
1474 ASSERT_EQ(1U, updated_audio_streams.size()); 1475 ASSERT_EQ(1U, updated_audio_streams.size());
1475 EXPECT_TRUE(audio_streams[0] == updated_audio_streams[0]); 1476 EXPECT_TRUE(audio_streams[0] == updated_audio_streams[0]);
1476 1477
1477 const StreamParamsVec& updated_video_streams = updated_vcd->streams(); 1478 const StreamParamsVec& updated_video_streams = updated_vcd->streams();
1478 ASSERT_EQ(2U, updated_video_streams.size()); 1479 ASSERT_EQ(2U, updated_video_streams.size());
1479 EXPECT_EQ(video_streams[0], updated_video_streams[0]); 1480 EXPECT_EQ(video_streams[0], updated_video_streams[0]);
1480 EXPECT_EQ(kVideoTrack2, updated_video_streams[1].id); 1481 EXPECT_EQ(kVideoTrack2, updated_video_streams[1].id);
1481 EXPECT_NE(updated_video_streams[1].cname, updated_video_streams[0].cname); 1482 // All media streams in one PeerConnection share one cname
1483 EXPECT_EQ(updated_video_streams[1].cname, updated_video_streams[0].cname);
1482 1484
1483 const StreamParamsVec& updated_data_streams = updated_dcd->streams(); 1485 const StreamParamsVec& updated_data_streams = updated_dcd->streams();
1484 ASSERT_EQ(1U, updated_data_streams.size()); 1486 ASSERT_EQ(1U, updated_data_streams.size());
1485 EXPECT_TRUE(data_streams[0] == updated_data_streams[0]); 1487 EXPECT_TRUE(data_streams[0] == updated_data_streams[0]);
1486 } 1488 }
1487 1489
1488 1490
1489 // Create an updated offer after creating an answer to the original offer and 1491 // Create an updated offer after creating an answer to the original offer and
1490 // verify that the codecs that were part of the original answer are not changed 1492 // verify that the codecs that were part of the original answer are not changed
1491 // in the updated offer. 1493 // in the updated offer.
(...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after
2384 const ContentInfo* audio_content = GetFirstAudioContent(updated_offer.get()); 2386 const ContentInfo* audio_content = GetFirstAudioContent(updated_offer.get());
2385 const ContentInfo* video_content = GetFirstVideoContent(updated_offer.get()); 2387 const ContentInfo* video_content = GetFirstVideoContent(updated_offer.get());
2386 const ContentInfo* data_content = GetFirstDataContent(updated_offer.get()); 2388 const ContentInfo* data_content = GetFirstDataContent(updated_offer.get());
2387 ASSERT_TRUE(audio_content != nullptr); 2389 ASSERT_TRUE(audio_content != nullptr);
2388 ASSERT_TRUE(video_content != nullptr); 2390 ASSERT_TRUE(video_content != nullptr);
2389 ASSERT_TRUE(data_content != nullptr); 2391 ASSERT_TRUE(data_content != nullptr);
2390 EXPECT_EQ("audio_modified", audio_content->name); 2392 EXPECT_EQ("audio_modified", audio_content->name);
2391 EXPECT_EQ("video_modified", video_content->name); 2393 EXPECT_EQ("video_modified", video_content->name);
2392 EXPECT_EQ("data_modified", data_content->name); 2394 EXPECT_EQ("data_modified", data_content->name);
2393 } 2395 }
OLDNEW
« webrtc/pc/mediasession.cc ('K') | « webrtc/pc/mediasession.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698