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

Side by Side Diff: webrtc/api/rtpsenderreceiver_unittest.cc

Issue 1766653002: Replace SetCapturer and SetCaptureDevice by SetSource. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebased, no longer any proxy object changes. 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
« no previous file with comments | « webrtc/api/rtpsender.cc ('k') | webrtc/api/videocapturertracksource.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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 } 63 }
64 64
65 private: 65 private:
66 rtc::scoped_ptr<AudioSinkInterface> sink_; 66 rtc::scoped_ptr<AudioSinkInterface> sink_;
67 }; 67 };
68 68
69 // Helper class to test RtpSender/RtpReceiver. 69 // Helper class to test RtpSender/RtpReceiver.
70 class MockVideoProvider : public VideoProviderInterface { 70 class MockVideoProvider : public VideoProviderInterface {
71 public: 71 public:
72 virtual ~MockVideoProvider() {} 72 virtual ~MockVideoProvider() {}
73 MOCK_METHOD2(SetCaptureDevice, 73 MOCK_METHOD2(SetSource,
74 bool(uint32_t ssrc, cricket::VideoCapturer* camera)); 74 bool(uint32_t ssrc,
75 rtc::VideoSourceInterface<cricket::VideoFrame>* source));
75 MOCK_METHOD3(SetVideoPlayout, 76 MOCK_METHOD3(SetVideoPlayout,
76 void(uint32_t ssrc, 77 void(uint32_t ssrc,
77 bool enable, 78 bool enable,
78 rtc::VideoSinkInterface<cricket::VideoFrame>* sink)); 79 rtc::VideoSinkInterface<cricket::VideoFrame>* sink));
79 MOCK_METHOD3(SetVideoSend, 80 MOCK_METHOD3(SetVideoSend,
80 void(uint32_t ssrc, 81 void(uint32_t ssrc,
81 bool enable, 82 bool enable,
82 const cricket::VideoOptions* options)); 83 const cricket::VideoOptions* options));
83 84
84 MOCK_CONST_METHOD1(GetVideoRtpParameters, RtpParameters(uint32_t ssrc)); 85 MOCK_CONST_METHOD1(GetVideoRtpParameters, RtpParameters(uint32_t ssrc));
(...skipping 19 matching lines...) Expand all
104 EXPECT_TRUE(stream_->AddTrack(audio_track_)); 105 EXPECT_TRUE(stream_->AddTrack(audio_track_));
105 EXPECT_CALL(audio_provider_, SetAudioSend(kAudioSsrc, true, _, _)); 106 EXPECT_CALL(audio_provider_, SetAudioSend(kAudioSsrc, true, _, _));
106 audio_rtp_sender_ = 107 audio_rtp_sender_ =
107 new AudioRtpSender(stream_->GetAudioTracks()[0], stream_->label(), 108 new AudioRtpSender(stream_->GetAudioTracks()[0], stream_->label(),
108 &audio_provider_, nullptr); 109 &audio_provider_, nullptr);
109 audio_rtp_sender_->SetSsrc(kAudioSsrc); 110 audio_rtp_sender_->SetSsrc(kAudioSsrc);
110 } 111 }
111 112
112 void CreateVideoRtpSender() { 113 void CreateVideoRtpSender() {
113 AddVideoTrack(); 114 AddVideoTrack();
114 EXPECT_CALL(video_provider_, 115 EXPECT_CALL(video_provider_, SetSource(kVideoSsrc, video_track_.get()));
115 SetCaptureDevice(
116 kVideoSsrc, video_track_->GetSource()->GetVideoCapturer()));
117 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc, true, _)); 116 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc, true, _));
118 video_rtp_sender_ = new VideoRtpSender(stream_->GetVideoTracks()[0], 117 video_rtp_sender_ = new VideoRtpSender(stream_->GetVideoTracks()[0],
119 stream_->label(), &video_provider_); 118 stream_->label(), &video_provider_);
120 video_rtp_sender_->SetSsrc(kVideoSsrc); 119 video_rtp_sender_->SetSsrc(kVideoSsrc);
121 } 120 }
122 121
123 void DestroyAudioRtpSender() { 122 void DestroyAudioRtpSender() {
124 EXPECT_CALL(audio_provider_, SetAudioSend(kAudioSsrc, false, _, _)) 123 EXPECT_CALL(audio_provider_, SetAudioSend(kAudioSsrc, false, _, _))
125 .Times(1); 124 .Times(1);
126 audio_rtp_sender_ = nullptr; 125 audio_rtp_sender_ = nullptr;
127 } 126 }
128 127
129 void DestroyVideoRtpSender() { 128 void DestroyVideoRtpSender() {
130 EXPECT_CALL(video_provider_, SetCaptureDevice(kVideoSsrc, NULL)).Times(1); 129 EXPECT_CALL(video_provider_, SetSource(kVideoSsrc, NULL)).Times(1);
131 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc, false, _)).Times(1); 130 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc, false, _)).Times(1);
132 video_rtp_sender_ = nullptr; 131 video_rtp_sender_ = nullptr;
133 } 132 }
134 133
135 void CreateAudioRtpReceiver() { 134 void CreateAudioRtpReceiver() {
136 audio_track_ = AudioTrack::Create( 135 audio_track_ = AudioTrack::Create(
137 kAudioTrackId, RemoteAudioSource::Create(kAudioSsrc, NULL)); 136 kAudioTrackId, RemoteAudioSource::Create(kAudioSsrc, NULL));
138 EXPECT_TRUE(stream_->AddTrack(audio_track_)); 137 EXPECT_TRUE(stream_->AddTrack(audio_track_));
139 EXPECT_CALL(audio_provider_, SetAudioPlayout(kAudioSsrc, true)); 138 EXPECT_CALL(audio_provider_, SetAudioPlayout(kAudioSsrc, true));
140 audio_rtp_receiver_ = new AudioRtpReceiver(stream_, kAudioTrackId, 139 audio_rtp_receiver_ = new AudioRtpReceiver(stream_, kAudioTrackId,
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 EXPECT_CALL(audio_provider_, SetAudioSend(kAudioSsrc, false, _, _)).Times(1); 337 EXPECT_CALL(audio_provider_, SetAudioSend(kAudioSsrc, false, _, _)).Times(1);
339 } 338 }
340 339
341 // Test that a video sender calls the expected methods on the provider once 340 // Test that a video sender calls the expected methods on the provider once
342 // it has a track and SSRC, when the SSRC is set first. 341 // it has a track and SSRC, when the SSRC is set first.
343 TEST_F(RtpSenderReceiverTest, VideoSenderEarlyWarmupSsrcThenTrack) { 342 TEST_F(RtpSenderReceiverTest, VideoSenderEarlyWarmupSsrcThenTrack) {
344 AddVideoTrack(); 343 AddVideoTrack();
345 rtc::scoped_refptr<VideoRtpSender> sender = 344 rtc::scoped_refptr<VideoRtpSender> sender =
346 new VideoRtpSender(&video_provider_); 345 new VideoRtpSender(&video_provider_);
347 sender->SetSsrc(kVideoSsrc); 346 sender->SetSsrc(kVideoSsrc);
348 EXPECT_CALL(video_provider_, 347 EXPECT_CALL(video_provider_, SetSource(kVideoSsrc, video_track_.get()));
349 SetCaptureDevice(kVideoSsrc,
350 video_track_->GetSource()->GetVideoCapturer()));
351 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc, true, _)); 348 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc, true, _));
352 sender->SetTrack(video_track_); 349 sender->SetTrack(video_track_);
353 350
354 // Calls expected from destructor. 351 // Calls expected from destructor.
355 EXPECT_CALL(video_provider_, SetCaptureDevice(kVideoSsrc, nullptr)).Times(1); 352 EXPECT_CALL(video_provider_, SetSource(kVideoSsrc, nullptr)).Times(1);
356 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc, false, _)).Times(1); 353 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc, false, _)).Times(1);
357 } 354 }
358 355
359 // Test that a video sender calls the expected methods on the provider once 356 // Test that a video sender calls the expected methods on the provider once
360 // it has a track and SSRC, when the SSRC is set last. 357 // it has a track and SSRC, when the SSRC is set last.
361 TEST_F(RtpSenderReceiverTest, VideoSenderEarlyWarmupTrackThenSsrc) { 358 TEST_F(RtpSenderReceiverTest, VideoSenderEarlyWarmupTrackThenSsrc) {
362 AddVideoTrack(); 359 AddVideoTrack();
363 rtc::scoped_refptr<VideoRtpSender> sender = 360 rtc::scoped_refptr<VideoRtpSender> sender =
364 new VideoRtpSender(&video_provider_); 361 new VideoRtpSender(&video_provider_);
365 sender->SetTrack(video_track_); 362 sender->SetTrack(video_track_);
366 EXPECT_CALL(video_provider_, 363 EXPECT_CALL(video_provider_, SetSource(kVideoSsrc, video_track_.get()));
367 SetCaptureDevice(kVideoSsrc,
368 video_track_->GetSource()->GetVideoCapturer()));
369 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc, true, _)); 364 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc, true, _));
370 sender->SetSsrc(kVideoSsrc); 365 sender->SetSsrc(kVideoSsrc);
371 366
372 // Calls expected from destructor. 367 // Calls expected from destructor.
373 EXPECT_CALL(video_provider_, SetCaptureDevice(kVideoSsrc, nullptr)).Times(1); 368 EXPECT_CALL(video_provider_, SetSource(kVideoSsrc, nullptr)).Times(1);
374 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc, false, _)).Times(1); 369 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc, false, _)).Times(1);
375 } 370 }
376 371
377 // Test that the sender is disconnected from the provider when its SSRC is 372 // Test that the sender is disconnected from the provider when its SSRC is
378 // set to 0. 373 // set to 0.
379 TEST_F(RtpSenderReceiverTest, AudioSenderSsrcSetToZero) { 374 TEST_F(RtpSenderReceiverTest, AudioSenderSsrcSetToZero) {
380 rtc::scoped_refptr<AudioTrackInterface> track = 375 rtc::scoped_refptr<AudioTrackInterface> track =
381 AudioTrack::Create(kAudioTrackId, nullptr); 376 AudioTrack::Create(kAudioTrackId, nullptr);
382 EXPECT_CALL(audio_provider_, SetAudioSend(kAudioSsrc, true, _, _)); 377 EXPECT_CALL(audio_provider_, SetAudioSend(kAudioSsrc, true, _, _));
383 rtc::scoped_refptr<AudioRtpSender> sender = 378 rtc::scoped_refptr<AudioRtpSender> sender =
384 new AudioRtpSender(track, kStreamLabel1, &audio_provider_, nullptr); 379 new AudioRtpSender(track, kStreamLabel1, &audio_provider_, nullptr);
385 sender->SetSsrc(kAudioSsrc); 380 sender->SetSsrc(kAudioSsrc);
386 381
387 EXPECT_CALL(audio_provider_, SetAudioSend(kAudioSsrc, false, _, _)).Times(1); 382 EXPECT_CALL(audio_provider_, SetAudioSend(kAudioSsrc, false, _, _)).Times(1);
388 sender->SetSsrc(0); 383 sender->SetSsrc(0);
389 384
390 // Make sure it's SetSsrc that called methods on the provider, and not the 385 // Make sure it's SetSsrc that called methods on the provider, and not the
391 // destructor. 386 // destructor.
392 EXPECT_CALL(audio_provider_, SetAudioSend(_, _, _, _)).Times(0); 387 EXPECT_CALL(audio_provider_, SetAudioSend(_, _, _, _)).Times(0);
393 } 388 }
394 389
395 // Test that the sender is disconnected from the provider when its SSRC is 390 // Test that the sender is disconnected from the provider when its SSRC is
396 // set to 0. 391 // set to 0.
397 TEST_F(RtpSenderReceiverTest, VideoSenderSsrcSetToZero) { 392 TEST_F(RtpSenderReceiverTest, VideoSenderSsrcSetToZero) {
398 AddVideoTrack(); 393 AddVideoTrack();
399 EXPECT_CALL(video_provider_, 394 EXPECT_CALL(video_provider_, SetSource(kVideoSsrc, video_track_.get()));
400 SetCaptureDevice(kVideoSsrc,
401 video_track_->GetSource()->GetVideoCapturer()));
402 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc, true, _)); 395 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc, true, _));
403 rtc::scoped_refptr<VideoRtpSender> sender = 396 rtc::scoped_refptr<VideoRtpSender> sender =
404 new VideoRtpSender(video_track_, kStreamLabel1, &video_provider_); 397 new VideoRtpSender(video_track_, kStreamLabel1, &video_provider_);
405 sender->SetSsrc(kVideoSsrc); 398 sender->SetSsrc(kVideoSsrc);
406 399
407 EXPECT_CALL(video_provider_, SetCaptureDevice(kVideoSsrc, nullptr)).Times(1); 400 EXPECT_CALL(video_provider_, SetSource(kVideoSsrc, nullptr)).Times(1);
408 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc, false, _)).Times(1); 401 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc, false, _)).Times(1);
409 sender->SetSsrc(0); 402 sender->SetSsrc(0);
410 403
411 // Make sure it's SetSsrc that called methods on the provider, and not the 404 // Make sure it's SetSsrc that called methods on the provider, and not the
412 // destructor. 405 // destructor.
413 EXPECT_CALL(video_provider_, SetCaptureDevice(_, _)).Times(0); 406 EXPECT_CALL(video_provider_, SetSource(_, _)).Times(0);
414 EXPECT_CALL(video_provider_, SetVideoSend(_, _, _)).Times(0); 407 EXPECT_CALL(video_provider_, SetVideoSend(_, _, _)).Times(0);
415 } 408 }
416 409
417 TEST_F(RtpSenderReceiverTest, AudioSenderTrackSetToNull) { 410 TEST_F(RtpSenderReceiverTest, AudioSenderTrackSetToNull) {
418 rtc::scoped_refptr<AudioTrackInterface> track = 411 rtc::scoped_refptr<AudioTrackInterface> track =
419 AudioTrack::Create(kAudioTrackId, nullptr); 412 AudioTrack::Create(kAudioTrackId, nullptr);
420 EXPECT_CALL(audio_provider_, SetAudioSend(kAudioSsrc, true, _, _)); 413 EXPECT_CALL(audio_provider_, SetAudioSend(kAudioSsrc, true, _, _));
421 rtc::scoped_refptr<AudioRtpSender> sender = 414 rtc::scoped_refptr<AudioRtpSender> sender =
422 new AudioRtpSender(track, kStreamLabel1, &audio_provider_, nullptr); 415 new AudioRtpSender(track, kStreamLabel1, &audio_provider_, nullptr);
423 sender->SetSsrc(kAudioSsrc); 416 sender->SetSsrc(kAudioSsrc);
424 417
425 EXPECT_CALL(audio_provider_, SetAudioSend(kAudioSsrc, false, _, _)).Times(1); 418 EXPECT_CALL(audio_provider_, SetAudioSend(kAudioSsrc, false, _, _)).Times(1);
426 EXPECT_TRUE(sender->SetTrack(nullptr)); 419 EXPECT_TRUE(sender->SetTrack(nullptr));
427 420
428 // Make sure it's SetTrack that called methods on the provider, and not the 421 // Make sure it's SetTrack that called methods on the provider, and not the
429 // destructor. 422 // destructor.
430 EXPECT_CALL(audio_provider_, SetAudioSend(_, _, _, _)).Times(0); 423 EXPECT_CALL(audio_provider_, SetAudioSend(_, _, _, _)).Times(0);
431 } 424 }
432 425
433 TEST_F(RtpSenderReceiverTest, VideoSenderTrackSetToNull) { 426 TEST_F(RtpSenderReceiverTest, VideoSenderTrackSetToNull) {
434 AddVideoTrack(); 427 AddVideoTrack();
435 EXPECT_CALL(video_provider_, 428 EXPECT_CALL(video_provider_, SetSource(kVideoSsrc, video_track_.get()));
436 SetCaptureDevice(kVideoSsrc,
437 video_track_->GetSource()->GetVideoCapturer()));
438 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc, true, _)); 429 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc, true, _));
439 rtc::scoped_refptr<VideoRtpSender> sender = 430 rtc::scoped_refptr<VideoRtpSender> sender =
440 new VideoRtpSender(video_track_, kStreamLabel1, &video_provider_); 431 new VideoRtpSender(video_track_, kStreamLabel1, &video_provider_);
441 sender->SetSsrc(kVideoSsrc); 432 sender->SetSsrc(kVideoSsrc);
442 433
443 EXPECT_CALL(video_provider_, SetCaptureDevice(kVideoSsrc, nullptr)).Times(1); 434 EXPECT_CALL(video_provider_, SetSource(kVideoSsrc, nullptr)).Times(1);
444 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc, false, _)).Times(1); 435 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc, false, _)).Times(1);
445 EXPECT_TRUE(sender->SetTrack(nullptr)); 436 EXPECT_TRUE(sender->SetTrack(nullptr));
446 437
447 // Make sure it's SetTrack that called methods on the provider, and not the 438 // Make sure it's SetTrack that called methods on the provider, and not the
448 // destructor. 439 // destructor.
449 EXPECT_CALL(video_provider_, SetCaptureDevice(_, _)).Times(0); 440 EXPECT_CALL(video_provider_, SetSource(_, _)).Times(0);
450 EXPECT_CALL(video_provider_, SetVideoSend(_, _, _)).Times(0); 441 EXPECT_CALL(video_provider_, SetVideoSend(_, _, _)).Times(0);
451 } 442 }
452 443
453 TEST_F(RtpSenderReceiverTest, AudioSenderSsrcChanged) { 444 TEST_F(RtpSenderReceiverTest, AudioSenderSsrcChanged) {
454 AddVideoTrack(); 445 AddVideoTrack();
455 rtc::scoped_refptr<AudioTrackInterface> track = 446 rtc::scoped_refptr<AudioTrackInterface> track =
456 AudioTrack::Create(kAudioTrackId, nullptr); 447 AudioTrack::Create(kAudioTrackId, nullptr);
457 EXPECT_CALL(audio_provider_, SetAudioSend(kAudioSsrc, true, _, _)); 448 EXPECT_CALL(audio_provider_, SetAudioSend(kAudioSsrc, true, _, _));
458 rtc::scoped_refptr<AudioRtpSender> sender = 449 rtc::scoped_refptr<AudioRtpSender> sender =
459 new AudioRtpSender(track, kStreamLabel1, &audio_provider_, nullptr); 450 new AudioRtpSender(track, kStreamLabel1, &audio_provider_, nullptr);
460 sender->SetSsrc(kAudioSsrc); 451 sender->SetSsrc(kAudioSsrc);
461 452
462 EXPECT_CALL(audio_provider_, SetAudioSend(kAudioSsrc, false, _, _)).Times(1); 453 EXPECT_CALL(audio_provider_, SetAudioSend(kAudioSsrc, false, _, _)).Times(1);
463 EXPECT_CALL(audio_provider_, SetAudioSend(kAudioSsrc2, true, _, _)).Times(1); 454 EXPECT_CALL(audio_provider_, SetAudioSend(kAudioSsrc2, true, _, _)).Times(1);
464 sender->SetSsrc(kAudioSsrc2); 455 sender->SetSsrc(kAudioSsrc2);
465 456
466 // Calls expected from destructor. 457 // Calls expected from destructor.
467 EXPECT_CALL(audio_provider_, SetAudioSend(kAudioSsrc2, false, _, _)).Times(1); 458 EXPECT_CALL(audio_provider_, SetAudioSend(kAudioSsrc2, false, _, _)).Times(1);
468 } 459 }
469 460
470 TEST_F(RtpSenderReceiverTest, VideoSenderSsrcChanged) { 461 TEST_F(RtpSenderReceiverTest, VideoSenderSsrcChanged) {
471 AddVideoTrack(); 462 AddVideoTrack();
472 EXPECT_CALL(video_provider_, 463 EXPECT_CALL(video_provider_, SetSource(kVideoSsrc, video_track_.get()));
473 SetCaptureDevice(kVideoSsrc,
474 video_track_->GetSource()->GetVideoCapturer()));
475 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc, true, _)); 464 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc, true, _));
476 rtc::scoped_refptr<VideoRtpSender> sender = 465 rtc::scoped_refptr<VideoRtpSender> sender =
477 new VideoRtpSender(video_track_, kStreamLabel1, &video_provider_); 466 new VideoRtpSender(video_track_, kStreamLabel1, &video_provider_);
478 sender->SetSsrc(kVideoSsrc); 467 sender->SetSsrc(kVideoSsrc);
479 468
480 EXPECT_CALL(video_provider_, SetCaptureDevice(kVideoSsrc, nullptr)).Times(1); 469 EXPECT_CALL(video_provider_, SetSource(kVideoSsrc, nullptr)).Times(1);
481 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc, false, _)).Times(1); 470 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc, false, _)).Times(1);
482 EXPECT_CALL(video_provider_, 471 EXPECT_CALL(video_provider_, SetSource(kVideoSsrc2, video_track_.get()));
483 SetCaptureDevice(kVideoSsrc2,
484 video_track_->GetSource()->GetVideoCapturer()));
485 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc2, true, _)); 472 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc2, true, _));
486 sender->SetSsrc(kVideoSsrc2); 473 sender->SetSsrc(kVideoSsrc2);
487 474
488 // Calls expected from destructor. 475 // Calls expected from destructor.
489 EXPECT_CALL(video_provider_, SetCaptureDevice(kVideoSsrc2, nullptr)).Times(1); 476 EXPECT_CALL(video_provider_, SetSource(kVideoSsrc2, nullptr)).Times(1);
490 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc2, false, _)).Times(1); 477 EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc2, false, _)).Times(1);
491 } 478 }
492 479
493 TEST_F(RtpSenderReceiverTest, AudioSenderCanSetParameters) { 480 TEST_F(RtpSenderReceiverTest, AudioSenderCanSetParameters) {
494 CreateAudioRtpSender(); 481 CreateAudioRtpSender();
495 482
496 EXPECT_CALL(audio_provider_, GetAudioRtpParameters(kAudioSsrc)) 483 EXPECT_CALL(audio_provider_, GetAudioRtpParameters(kAudioSsrc))
497 .WillOnce(Return(RtpParameters())); 484 .WillOnce(Return(RtpParameters()));
498 EXPECT_CALL(audio_provider_, SetAudioRtpParameters(kAudioSsrc, _)) 485 EXPECT_CALL(audio_provider_, SetAudioRtpParameters(kAudioSsrc, _))
499 .WillOnce(Return(true)); 486 .WillOnce(Return(true));
(...skipping 10 matching lines...) Expand all
510 .WillOnce(Return(RtpParameters())); 497 .WillOnce(Return(RtpParameters()));
511 EXPECT_CALL(video_provider_, SetVideoRtpParameters(kVideoSsrc, _)) 498 EXPECT_CALL(video_provider_, SetVideoRtpParameters(kVideoSsrc, _))
512 .WillOnce(Return(true)); 499 .WillOnce(Return(true));
513 RtpParameters params = video_rtp_sender_->GetParameters(); 500 RtpParameters params = video_rtp_sender_->GetParameters();
514 EXPECT_TRUE(video_rtp_sender_->SetParameters(params)); 501 EXPECT_TRUE(video_rtp_sender_->SetParameters(params));
515 502
516 DestroyVideoRtpSender(); 503 DestroyVideoRtpSender();
517 } 504 }
518 505
519 } // namespace webrtc 506 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/api/rtpsender.cc ('k') | webrtc/api/videocapturertracksource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698