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

Side by Side Diff: talk/app/webrtc/peerconnectioninterface_unittest.cc

Issue 1538673002: Adding a MediaStream parameter to createSender. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Just take a string as a parameter, for simplicity. Created 5 years 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 | « talk/app/webrtc/peerconnectioninterface.h ('k') | talk/app/webrtc/peerconnectionproxy.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 * libjingle 2 * libjingle
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 stream->RemoveTrack(stream->GetVideoTracks()[0]); 1191 stream->RemoveTrack(stream->GetVideoTracks()[0]);
1192 1192
1193 scoped_ptr<SessionDescriptionInterface> offer; 1193 scoped_ptr<SessionDescriptionInterface> offer;
1194 ASSERT_TRUE(DoCreateOffer(offer.use(), nullptr)); 1194 ASSERT_TRUE(DoCreateOffer(offer.use(), nullptr));
1195 1195
1196 const cricket::MediaContentDescription* video_desc = 1196 const cricket::MediaContentDescription* video_desc =
1197 cricket::GetFirstVideoContentDescription(offer->description()); 1197 cricket::GetFirstVideoContentDescription(offer->description());
1198 EXPECT_TRUE(video_desc == nullptr); 1198 EXPECT_TRUE(video_desc == nullptr);
1199 } 1199 }
1200 1200
1201 // Test creating a sender with a stream ID, and ensure the ID is populated
1202 // in the offer.
1203 TEST_F(PeerConnectionInterfaceTest, CreateSenderWithStream) {
1204 CreatePeerConnection();
1205 pc_->CreateSender("video", kStreamLabel1);
1206
1207 scoped_ptr<SessionDescriptionInterface> offer;
1208 ASSERT_TRUE(DoCreateOffer(offer.use(), nullptr));
1209
1210 const cricket::MediaContentDescription* video_desc =
1211 cricket::GetFirstVideoContentDescription(offer->description());
1212 ASSERT_TRUE(video_desc != nullptr);
1213 ASSERT_EQ(1u, video_desc->streams().size());
1214 EXPECT_EQ(kStreamLabel1, video_desc->streams()[0].sync_label);
1215 }
1216
1201 // Test that we can specify a certain track that we want statistics about. 1217 // Test that we can specify a certain track that we want statistics about.
1202 TEST_F(PeerConnectionInterfaceTest, GetStatsForSpecificTrack) { 1218 TEST_F(PeerConnectionInterfaceTest, GetStatsForSpecificTrack) {
1203 InitiateCall(); 1219 InitiateCall();
1204 ASSERT_LT(0u, pc_->remote_streams()->count()); 1220 ASSERT_LT(0u, pc_->remote_streams()->count());
1205 ASSERT_LT(0u, pc_->remote_streams()->at(0)->GetAudioTracks().size()); 1221 ASSERT_LT(0u, pc_->remote_streams()->at(0)->GetAudioTracks().size());
1206 scoped_refptr<MediaStreamTrackInterface> remote_audio = 1222 scoped_refptr<MediaStreamTrackInterface> remote_audio =
1207 pc_->remote_streams()->at(0)->GetAudioTracks()[0]; 1223 pc_->remote_streams()->at(0)->GetAudioTracks()[0];
1208 EXPECT_TRUE(DoGetStats(remote_audio)); 1224 EXPECT_TRUE(DoGetStats(remote_audio));
1209 1225
1210 // Remove the stream. Since we are sending to our selves the local 1226 // Remove the stream. Since we are sending to our selves the local
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after
2391 FakeConstraints updated_answer_c; 2407 FakeConstraints updated_answer_c;
2392 answer_c.SetMandatoryReceiveAudio(false); 2408 answer_c.SetMandatoryReceiveAudio(false);
2393 answer_c.SetMandatoryReceiveVideo(false); 2409 answer_c.SetMandatoryReceiveVideo(false);
2394 2410
2395 cricket::MediaSessionOptions updated_answer_options; 2411 cricket::MediaSessionOptions updated_answer_options;
2396 EXPECT_TRUE( 2412 EXPECT_TRUE(
2397 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options)); 2413 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options));
2398 EXPECT_TRUE(updated_answer_options.has_audio()); 2414 EXPECT_TRUE(updated_answer_options.has_audio());
2399 EXPECT_TRUE(updated_answer_options.has_video()); 2415 EXPECT_TRUE(updated_answer_options.has_video());
2400 } 2416 }
OLDNEW
« no previous file with comments | « talk/app/webrtc/peerconnectioninterface.h ('k') | talk/app/webrtc/peerconnectionproxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698