OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // This test generate synthetic data. For audio it's a sinusoid waveform with | 5 // This test generate synthetic data. For audio it's a sinusoid waveform with |
6 // frequency kSoundFrequency and different amplitudes. For video it's a pattern | 6 // frequency kSoundFrequency and different amplitudes. For video it's a pattern |
7 // that is shifting by one pixel per frame, each pixels neighbors right and down | 7 // that is shifting by one pixel per frame, each pixels neighbors right and down |
8 // is this pixels value +1, since the pixel value is 8 bit it will wrap | 8 // is this pixels value +1, since the pixel value is 8 bit it will wrap |
9 // frequently within the image. Visually this will create diagonally color bands | 9 // frequently within the image. Visually this will create diagonally color bands |
10 // that moves across the screen | 10 // that moves across the screen |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 config.enable_raw_data_collection = true; | 333 config.enable_raw_data_collection = true; |
334 config.enable_stats_data_collection = true; | 334 config.enable_stats_data_collection = true; |
335 return config; | 335 return config; |
336 } | 336 } |
337 // The actual test class, generate synthetic data for both audio and video and | 337 // The actual test class, generate synthetic data for both audio and video and |
338 // send those through the sender and receiver and analyzes the result. | 338 // send those through the sender and receiver and analyzes the result. |
339 class End2EndTest : public ::testing::Test { | 339 class End2EndTest : public ::testing::Test { |
340 protected: | 340 protected: |
341 End2EndTest() | 341 End2EndTest() |
342 : start_time_(), | 342 : start_time_(), |
343 task_runner_(new test::FakeTaskRunner(&testing_clock_)), | 343 testing_clock_(new base::SimpleTestTickClock()), |
344 transport_task_runner_(new test::FakeTaskRunner(&testing_clock_)), | 344 task_runner_(new test::FakeTaskRunner(testing_clock_)), |
345 cast_environment_sender_(new CastEnvironment(&testing_clock_, | 345 transport_task_runner_(new test::FakeTaskRunner(testing_clock_)), |
| 346 cast_environment_(new CastEnvironment( |
| 347 scoped_ptr<base::TickClock>(testing_clock_).Pass(), |
346 task_runner_, task_runner_, task_runner_, task_runner_, | 348 task_runner_, task_runner_, task_runner_, task_runner_, |
347 task_runner_, task_runner_, EnableCastLoggingConfig(true))), | 349 task_runner_, task_runner_, EnableCastLoggingConfig(true))), |
348 cast_environment_receiver_(new CastEnvironment(&testing_clock_, | 350 receiver_to_sender_(cast_environment_), |
349 task_runner_, task_runner_, task_runner_, task_runner_, | 351 sender_to_receiver_(cast_environment_), |
350 task_runner_, task_runner_, EnableCastLoggingConfig(false))), | |
351 receiver_to_sender_(cast_environment_receiver_), | |
352 sender_to_receiver_(cast_environment_sender_), | |
353 test_receiver_audio_callback_(new TestReceiverAudioCallback()), | 352 test_receiver_audio_callback_(new TestReceiverAudioCallback()), |
354 test_receiver_video_callback_(new TestReceiverVideoCallback()) { | 353 test_receiver_video_callback_(new TestReceiverVideoCallback()) { |
355 testing_clock_.Advance( | 354 testing_clock_->Advance( |
356 base::TimeDelta::FromMilliseconds(kStartMillisecond)); | 355 base::TimeDelta::FromMilliseconds(kStartMillisecond)); |
357 } | 356 } |
358 | 357 |
359 void SetupConfig(transport::AudioCodec audio_codec, | 358 void SetupConfig(transport::AudioCodec audio_codec, |
360 int audio_sampling_frequency, | 359 int audio_sampling_frequency, |
361 // TODO(miu): 3rd arg is meaningless?!? | 360 // TODO(miu): 3rd arg is meaningless?!? |
362 bool external_audio_decoder, | 361 bool external_audio_decoder, |
363 int max_number_of_video_buffers_used) { | 362 int max_number_of_video_buffers_used) { |
364 audio_sender_config_.sender_ssrc = 1; | 363 audio_sender_config_.sender_ssrc = 1; |
365 audio_sender_config_.incoming_feedback_ssrc = 2; | 364 audio_sender_config_.incoming_feedback_ssrc = 2; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 transport_config_.audio_frequency = audio_sender_config_.frequency; | 420 transport_config_.audio_frequency = audio_sender_config_.frequency; |
422 transport_config_.audio_channels = audio_sender_config_.channels; | 421 transport_config_.audio_channels = audio_sender_config_.channels; |
423 transport_config_.video_rtp_max_delay_ms = | 422 transport_config_.video_rtp_max_delay_ms = |
424 video_sender_config_.rtp_max_delay_ms; | 423 video_sender_config_.rtp_max_delay_ms; |
425 transport_config_.audio_rtp_max_delay_ms = | 424 transport_config_.audio_rtp_max_delay_ms = |
426 audio_sender_config_.rtp_max_delay_ms; | 425 audio_sender_config_.rtp_max_delay_ms; |
427 } | 426 } |
428 | 427 |
429 void Create() { | 428 void Create() { |
430 cast_receiver_.reset(CastReceiver::CreateCastReceiver( | 429 cast_receiver_.reset(CastReceiver::CreateCastReceiver( |
431 cast_environment_receiver_, | 430 cast_environment_, |
432 audio_receiver_config_, | 431 audio_receiver_config_, |
433 video_receiver_config_, | 432 video_receiver_config_, |
434 &receiver_to_sender_)); | 433 &receiver_to_sender_)); |
435 transport_sender_.reset(new transport::CastTransportSenderImpl( | 434 transport_sender_.reset(new transport::CastTransportSenderImpl( |
436 &testing_clock_, | 435 testing_clock_, |
437 transport_config_, | 436 transport_config_, |
438 base::Bind(&UpdateCastTransportStatus), | 437 base::Bind(&UpdateCastTransportStatus), |
439 transport_task_runner_)); | 438 transport_task_runner_)); |
440 transport_sender_->InsertFakeTransportForTesting(&sender_to_receiver_); | 439 transport_sender_->InsertFakeTransportForTesting(&sender_to_receiver_); |
441 | 440 |
442 cast_sender_.reset(CastSender::CreateCastSender(cast_environment_sender_, | 441 cast_sender_.reset(CastSender::CreateCastSender(cast_environment_, |
443 audio_sender_config_, | 442 audio_sender_config_, |
444 video_sender_config_, | 443 video_sender_config_, |
445 NULL, | 444 NULL, |
446 transport_sender_.get())); | 445 transport_sender_.get())); |
447 | 446 |
448 receiver_to_sender_.SetPacketReceiver(cast_sender_->packet_receiver()); | 447 receiver_to_sender_.SetPacketReceiver(cast_sender_->packet_receiver()); |
449 sender_to_receiver_.SetPacketReceiver(cast_receiver_->packet_receiver()); | 448 sender_to_receiver_.SetPacketReceiver(cast_receiver_->packet_receiver()); |
450 | 449 |
451 frame_input_ = cast_sender_->frame_input(); | 450 frame_input_ = cast_sender_->frame_input(); |
452 frame_receiver_ = cast_receiver_->frame_receiver(); | 451 frame_receiver_ = cast_receiver_->frame_receiver(); |
453 | 452 |
454 audio_bus_factory_.reset(new TestAudioBusFactory( | 453 audio_bus_factory_.reset(new TestAudioBusFactory( |
455 audio_sender_config_.channels, audio_sender_config_.frequency, | 454 audio_sender_config_.channels, audio_sender_config_.frequency, |
456 kSoundFrequency, kSoundVolume)); | 455 kSoundFrequency, kSoundVolume)); |
457 } | 456 } |
458 | 457 |
459 virtual ~End2EndTest() {} | 458 virtual ~End2EndTest() {} |
460 | 459 |
461 void SendVideoFrame(int start_value, const base::TimeTicks& capture_time) { | 460 void SendVideoFrame(int start_value, const base::TimeTicks& capture_time) { |
462 if (start_time_.is_null()) | 461 if (start_time_.is_null()) |
463 start_time_ = testing_clock_.NowTicks(); | 462 start_time_ = testing_clock_->NowTicks(); |
464 start_time_ = testing_clock_.NowTicks(); | 463 start_time_ = testing_clock_->NowTicks(); |
465 base::TimeDelta time_diff = testing_clock_.NowTicks() - start_time_; | 464 base::TimeDelta time_diff = testing_clock_->NowTicks() - start_time_; |
466 gfx::Size size(kVideoWidth, kVideoHeight); | 465 gfx::Size size(kVideoWidth, kVideoHeight); |
467 EXPECT_TRUE(VideoFrame::IsValidConfig(VideoFrame::I420, | 466 EXPECT_TRUE(VideoFrame::IsValidConfig(VideoFrame::I420, |
468 size, gfx::Rect(size), size)); | 467 size, gfx::Rect(size), size)); |
469 scoped_refptr<media::VideoFrame> video_frame = | 468 scoped_refptr<media::VideoFrame> video_frame = |
470 media::VideoFrame::CreateFrame( | 469 media::VideoFrame::CreateFrame( |
471 VideoFrame::I420, size, gfx::Rect(size), size, time_diff); | 470 VideoFrame::I420, size, gfx::Rect(size), size, time_diff); |
472 PopulateVideoFrame(video_frame, start_value); | 471 PopulateVideoFrame(video_frame, start_value); |
473 frame_input_->InsertRawVideoFrame(video_frame, capture_time); | 472 frame_input_->InsertRawVideoFrame(video_frame, capture_time); |
474 } | 473 } |
475 | 474 |
476 void RunTasks(int during_ms) { | 475 void RunTasks(int during_ms) { |
477 for (int i = 0; i < during_ms; ++i) { | 476 for (int i = 0; i < during_ms; ++i) { |
478 // Call process the timers every 1 ms. | 477 // Call process the timers every 1 ms. |
479 testing_clock_.Advance(base::TimeDelta::FromMilliseconds(1)); | 478 testing_clock_->Advance(base::TimeDelta::FromMilliseconds(1)); |
480 task_runner_->RunTasks(); | 479 task_runner_->RunTasks(); |
481 transport_task_runner_->RunTasks(); | 480 transport_task_runner_->RunTasks(); |
482 } | 481 } |
483 } | 482 } |
484 | 483 |
485 AudioReceiverConfig audio_receiver_config_; | 484 AudioReceiverConfig audio_receiver_config_; |
486 VideoReceiverConfig video_receiver_config_; | 485 VideoReceiverConfig video_receiver_config_; |
487 AudioSenderConfig audio_sender_config_; | 486 AudioSenderConfig audio_sender_config_; |
488 VideoSenderConfig video_sender_config_; | 487 VideoSenderConfig video_sender_config_; |
489 transport::CastTransportConfig transport_config_; | 488 transport::CastTransportConfig transport_config_; |
490 | 489 |
491 base::SimpleTestTickClock testing_clock_; | |
492 base::TimeTicks start_time_; | 490 base::TimeTicks start_time_; |
| 491 base::SimpleTestTickClock* testing_clock_; // Owned by CastEnvironment. |
493 scoped_refptr<test::FakeTaskRunner> task_runner_; | 492 scoped_refptr<test::FakeTaskRunner> task_runner_; |
494 scoped_refptr<test::FakeTaskRunner> transport_task_runner_; | 493 scoped_refptr<test::FakeTaskRunner> transport_task_runner_; |
495 scoped_refptr<CastEnvironment> cast_environment_sender_; | 494 scoped_refptr<CastEnvironment> cast_environment_; |
496 scoped_refptr<CastEnvironment> cast_environment_receiver_; | |
497 | 495 |
498 LoopBackTransport receiver_to_sender_; | 496 LoopBackTransport receiver_to_sender_; |
499 LoopBackTransport sender_to_receiver_; | 497 LoopBackTransport sender_to_receiver_; |
500 scoped_ptr<transport::CastTransportSenderImpl> transport_sender_; | 498 scoped_ptr<transport::CastTransportSenderImpl> transport_sender_; |
501 | 499 |
502 scoped_ptr<CastReceiver> cast_receiver_; | 500 scoped_ptr<CastReceiver> cast_receiver_; |
503 scoped_ptr<CastSender> cast_sender_; | 501 scoped_ptr<CastSender> cast_sender_; |
504 scoped_refptr<FrameInput> frame_input_; | 502 scoped_refptr<FrameInput> frame_input_; |
505 scoped_refptr<FrameReceiver> frame_receiver_; | 503 scoped_refptr<FrameReceiver> frame_receiver_; |
506 | 504 |
507 scoped_refptr<TestReceiverAudioCallback> test_receiver_audio_callback_; | 505 scoped_refptr<TestReceiverAudioCallback> test_receiver_audio_callback_; |
508 scoped_refptr<TestReceiverVideoCallback> test_receiver_video_callback_; | 506 scoped_refptr<TestReceiverVideoCallback> test_receiver_video_callback_; |
509 | 507 |
510 scoped_ptr<TestAudioBusFactory> audio_bus_factory_; | 508 scoped_ptr<TestAudioBusFactory> audio_bus_factory_; |
511 }; | 509 }; |
512 | 510 |
513 // Audio and video test without packet loss using raw PCM 16 audio "codec"; | 511 // Audio and video test without packet loss using raw PCM 16 audio "codec"; |
514 // This test is too slow. Disabled for now: crbug.com/329333. | 512 // This test is too slow. Disabled for now: crbug.com/329333. |
515 TEST_F(End2EndTest, DISABLED_LoopNoLossPcm16) { | 513 TEST_F(End2EndTest, DISABLED_LoopNoLossPcm16) { |
516 SetupConfig(transport::kPcm16, 32000, false, 1); | 514 SetupConfig(transport::kPcm16, 32000, false, 1); |
517 Create(); | 515 Create(); |
518 | 516 |
519 int video_start = 1; | 517 int video_start = 1; |
520 int audio_diff = kFrameTimerMs; | 518 int audio_diff = kFrameTimerMs; |
521 int i = 0; | 519 int i = 0; |
522 | 520 |
523 for (; i < 10; ++i) { | 521 for (; i < 10; ++i) { |
524 int num_10ms_blocks = audio_diff / 10; | 522 int num_10ms_blocks = audio_diff / 10; |
525 audio_diff -= num_10ms_blocks * 10; | 523 audio_diff -= num_10ms_blocks * 10; |
526 base::TimeTicks send_time = testing_clock_.NowTicks(); | 524 base::TimeTicks send_time = testing_clock_->NowTicks(); |
527 | 525 |
528 test_receiver_video_callback_->AddExpectedResult(video_start, | 526 test_receiver_video_callback_->AddExpectedResult(video_start, |
529 video_sender_config_.width, video_sender_config_.height, send_time); | 527 video_sender_config_.width, video_sender_config_.height, send_time); |
530 | 528 |
531 scoped_ptr<AudioBus> audio_bus(audio_bus_factory_->NextAudioBus( | 529 scoped_ptr<AudioBus> audio_bus(audio_bus_factory_->NextAudioBus( |
532 base::TimeDelta::FromMilliseconds(10) * num_10ms_blocks)); | 530 base::TimeDelta::FromMilliseconds(10) * num_10ms_blocks)); |
533 | 531 |
534 if (i != 0) { | 532 if (i != 0) { |
535 // Due to the re-sampler and NetEq in the webrtc AudioCodingModule the | 533 // Due to the re-sampler and NetEq in the webrtc AudioCodingModule the |
536 // first samples will be 0 and then slowly ramp up to its real amplitude; | 534 // first samples will be 0 and then slowly ramp up to its real amplitude; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 #define MAYBE_LoopNoLossPcm16ExternalDecoder LoopNoLossPcm16ExternalDecoder | 580 #define MAYBE_LoopNoLossPcm16ExternalDecoder LoopNoLossPcm16ExternalDecoder |
583 #endif | 581 #endif |
584 // This tests our external decoder interface for Audio. | 582 // This tests our external decoder interface for Audio. |
585 // Audio test without packet loss using raw PCM 16 audio "codec"; | 583 // Audio test without packet loss using raw PCM 16 audio "codec"; |
586 TEST_F(End2EndTest, MAYBE_LoopNoLossPcm16ExternalDecoder) { | 584 TEST_F(End2EndTest, MAYBE_LoopNoLossPcm16ExternalDecoder) { |
587 SetupConfig(transport::kPcm16, 32000, true, 1); | 585 SetupConfig(transport::kPcm16, 32000, true, 1); |
588 Create(); | 586 Create(); |
589 | 587 |
590 int i = 0; | 588 int i = 0; |
591 for (; i < 10; ++i) { | 589 for (; i < 10; ++i) { |
592 base::TimeTicks send_time = testing_clock_.NowTicks(); | 590 base::TimeTicks send_time = testing_clock_->NowTicks(); |
593 scoped_ptr<AudioBus> audio_bus(audio_bus_factory_->NextAudioBus( | 591 scoped_ptr<AudioBus> audio_bus(audio_bus_factory_->NextAudioBus( |
594 base::TimeDelta::FromMilliseconds(10))); | 592 base::TimeDelta::FromMilliseconds(10))); |
595 test_receiver_audio_callback_->AddExpectedResult( | 593 test_receiver_audio_callback_->AddExpectedResult( |
596 ToPcmAudioFrame(*audio_bus, audio_sender_config_.frequency), | 594 ToPcmAudioFrame(*audio_bus, audio_sender_config_.frequency), |
597 1, send_time); | 595 1, send_time); |
598 | 596 |
599 AudioBus* const audio_bus_ptr = audio_bus.get(); | 597 AudioBus* const audio_bus_ptr = audio_bus.get(); |
600 frame_input_->InsertAudio(audio_bus_ptr, send_time, | 598 frame_input_->InsertAudio(audio_bus_ptr, send_time, |
601 base::Bind(&OwnThatAudioBus, base::Passed(&audio_bus))); | 599 base::Bind(&OwnThatAudioBus, base::Passed(&audio_bus))); |
602 | 600 |
(...skipping 13 matching lines...) Expand all Loading... |
616 #define MAYBE_LoopNoLossOpus LoopNoLossOpus | 614 #define MAYBE_LoopNoLossOpus LoopNoLossOpus |
617 #endif | 615 #endif |
618 // This tests our Opus audio codec without video. | 616 // This tests our Opus audio codec without video. |
619 TEST_F(End2EndTest, MAYBE_LoopNoLossOpus) { | 617 TEST_F(End2EndTest, MAYBE_LoopNoLossOpus) { |
620 SetupConfig(transport::kOpus, kDefaultAudioSamplingRate, false, 1); | 618 SetupConfig(transport::kOpus, kDefaultAudioSamplingRate, false, 1); |
621 Create(); | 619 Create(); |
622 | 620 |
623 int i = 0; | 621 int i = 0; |
624 for (; i < 10; ++i) { | 622 for (; i < 10; ++i) { |
625 int num_10ms_blocks = 3; | 623 int num_10ms_blocks = 3; |
626 base::TimeTicks send_time = testing_clock_.NowTicks(); | 624 base::TimeTicks send_time = testing_clock_->NowTicks(); |
627 | 625 |
628 scoped_ptr<AudioBus> audio_bus(audio_bus_factory_->NextAudioBus( | 626 scoped_ptr<AudioBus> audio_bus(audio_bus_factory_->NextAudioBus( |
629 base::TimeDelta::FromMilliseconds(10) * num_10ms_blocks)); | 627 base::TimeDelta::FromMilliseconds(10) * num_10ms_blocks)); |
630 | 628 |
631 if (i != 0) { | 629 if (i != 0) { |
632 test_receiver_audio_callback_->AddExpectedResult( | 630 test_receiver_audio_callback_->AddExpectedResult( |
633 ToPcmAudioFrame(*audio_bus, audio_sender_config_.frequency), | 631 ToPcmAudioFrame(*audio_bus, audio_sender_config_.frequency), |
634 num_10ms_blocks, send_time); | 632 num_10ms_blocks, send_time); |
635 } | 633 } |
636 | 634 |
(...skipping 29 matching lines...) Expand all Loading... |
666 | 664 |
667 int video_start = 1; | 665 int video_start = 1; |
668 int audio_diff = kFrameTimerMs; | 666 int audio_diff = kFrameTimerMs; |
669 | 667 |
670 sender_to_receiver_.SetSendPackets(false); | 668 sender_to_receiver_.SetSendPackets(false); |
671 | 669 |
672 for (int i = 0; i < 3; ++i) { | 670 for (int i = 0; i < 3; ++i) { |
673 int num_10ms_blocks = audio_diff / 10; | 671 int num_10ms_blocks = audio_diff / 10; |
674 audio_diff -= num_10ms_blocks * 10; | 672 audio_diff -= num_10ms_blocks * 10; |
675 | 673 |
676 base::TimeTicks send_time = testing_clock_.NowTicks(); | 674 base::TimeTicks send_time = testing_clock_->NowTicks(); |
677 scoped_ptr<AudioBus> audio_bus(audio_bus_factory_->NextAudioBus( | 675 scoped_ptr<AudioBus> audio_bus(audio_bus_factory_->NextAudioBus( |
678 base::TimeDelta::FromMilliseconds(10) * num_10ms_blocks)); | 676 base::TimeDelta::FromMilliseconds(10) * num_10ms_blocks)); |
679 | 677 |
680 AudioBus* const audio_bus_ptr = audio_bus.get(); | 678 AudioBus* const audio_bus_ptr = audio_bus.get(); |
681 frame_input_->InsertAudio(audio_bus_ptr, send_time, | 679 frame_input_->InsertAudio(audio_bus_ptr, send_time, |
682 base::Bind(&OwnThatAudioBus, base::Passed(&audio_bus))); | 680 base::Bind(&OwnThatAudioBus, base::Passed(&audio_bus))); |
683 | 681 |
684 SendVideoFrame(video_start, send_time); | 682 SendVideoFrame(video_start, send_time); |
685 RunTasks(kFrameTimerMs); | 683 RunTasks(kFrameTimerMs); |
686 audio_diff += kFrameTimerMs; | 684 audio_diff += kFrameTimerMs; |
687 video_start++; | 685 video_start++; |
688 } | 686 } |
689 RunTasks(100); | 687 RunTasks(100); |
690 sender_to_receiver_.SetSendPackets(true); | 688 sender_to_receiver_.SetSendPackets(true); |
691 | 689 |
692 int j = 0; | 690 int j = 0; |
693 const int number_of_audio_frames_to_ignore = 3; | 691 const int number_of_audio_frames_to_ignore = 3; |
694 for (; j < 10; ++j) { | 692 for (; j < 10; ++j) { |
695 int num_10ms_blocks = audio_diff / 10; | 693 int num_10ms_blocks = audio_diff / 10; |
696 audio_diff -= num_10ms_blocks * 10; | 694 audio_diff -= num_10ms_blocks * 10; |
697 base::TimeTicks send_time = testing_clock_.NowTicks(); | 695 base::TimeTicks send_time = testing_clock_->NowTicks(); |
698 | 696 |
699 scoped_ptr<AudioBus> audio_bus(audio_bus_factory_->NextAudioBus( | 697 scoped_ptr<AudioBus> audio_bus(audio_bus_factory_->NextAudioBus( |
700 base::TimeDelta::FromMilliseconds(10) * num_10ms_blocks)); | 698 base::TimeDelta::FromMilliseconds(10) * num_10ms_blocks)); |
701 | 699 |
702 if (j >= number_of_audio_frames_to_ignore) { | 700 if (j >= number_of_audio_frames_to_ignore) { |
703 test_receiver_audio_callback_->AddExpectedResult( | 701 test_receiver_audio_callback_->AddExpectedResult( |
704 ToPcmAudioFrame(*audio_bus, audio_sender_config_.frequency), | 702 ToPcmAudioFrame(*audio_bus, audio_sender_config_.frequency), |
705 num_10ms_blocks, send_time); | 703 num_10ms_blocks, send_time); |
706 } | 704 } |
707 | 705 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 } | 737 } |
740 | 738 |
741 // This tests a network glitch lasting for 10 video frames. | 739 // This tests a network glitch lasting for 10 video frames. |
742 TEST_F(End2EndTest, GlitchWith3Buffers) { | 740 TEST_F(End2EndTest, GlitchWith3Buffers) { |
743 SetupConfig(transport::kOpus, kDefaultAudioSamplingRate, false, 3); | 741 SetupConfig(transport::kOpus, kDefaultAudioSamplingRate, false, 3); |
744 video_sender_config_.rtp_max_delay_ms = 67; | 742 video_sender_config_.rtp_max_delay_ms = 67; |
745 video_receiver_config_.rtp_max_delay_ms = 67; | 743 video_receiver_config_.rtp_max_delay_ms = 67; |
746 Create(); | 744 Create(); |
747 | 745 |
748 int video_start = 50; | 746 int video_start = 50; |
749 base::TimeTicks send_time = testing_clock_.NowTicks(); | 747 base::TimeTicks send_time = testing_clock_->NowTicks(); |
750 SendVideoFrame(video_start, send_time); | 748 SendVideoFrame(video_start, send_time); |
751 RunTasks(kFrameTimerMs); | 749 RunTasks(kFrameTimerMs); |
752 | 750 |
753 test_receiver_video_callback_->AddExpectedResult(video_start, | 751 test_receiver_video_callback_->AddExpectedResult(video_start, |
754 video_sender_config_.width, video_sender_config_.height, send_time); | 752 video_sender_config_.width, video_sender_config_.height, send_time); |
755 frame_receiver_->GetRawVideoFrame( | 753 frame_receiver_->GetRawVideoFrame( |
756 base::Bind(&TestReceiverVideoCallback::CheckVideoFrame, | 754 base::Bind(&TestReceiverVideoCallback::CheckVideoFrame, |
757 test_receiver_video_callback_)); | 755 test_receiver_video_callback_)); |
758 | 756 |
759 RunTasks(750); // Make sure that we send a RTCP packet. | 757 RunTasks(750); // Make sure that we send a RTCP packet. |
760 | 758 |
761 video_start++; | 759 video_start++; |
762 | 760 |
763 // Introduce a glitch lasting for 10 frames. | 761 // Introduce a glitch lasting for 10 frames. |
764 sender_to_receiver_.SetSendPackets(false); | 762 sender_to_receiver_.SetSendPackets(false); |
765 for (int i = 0; i < 10; ++i) { | 763 for (int i = 0; i < 10; ++i) { |
766 send_time = testing_clock_.NowTicks(); | 764 send_time = testing_clock_->NowTicks(); |
767 // First 3 will be sent and lost. | 765 // First 3 will be sent and lost. |
768 SendVideoFrame(video_start, send_time); | 766 SendVideoFrame(video_start, send_time); |
769 RunTasks(kFrameTimerMs); | 767 RunTasks(kFrameTimerMs); |
770 video_start++; | 768 video_start++; |
771 } | 769 } |
772 sender_to_receiver_.SetSendPackets(true); | 770 sender_to_receiver_.SetSendPackets(true); |
773 RunTasks(100); | 771 RunTasks(100); |
774 send_time = testing_clock_.NowTicks(); | 772 send_time = testing_clock_->NowTicks(); |
775 | 773 |
776 // Frame 1 should be acked by now and we should have an opening to send 4. | 774 // Frame 1 should be acked by now and we should have an opening to send 4. |
777 SendVideoFrame(video_start, send_time); | 775 SendVideoFrame(video_start, send_time); |
778 RunTasks(kFrameTimerMs); | 776 RunTasks(kFrameTimerMs); |
779 | 777 |
780 test_receiver_video_callback_->AddExpectedResult(video_start, | 778 test_receiver_video_callback_->AddExpectedResult(video_start, |
781 video_sender_config_.width, video_sender_config_.height, send_time); | 779 video_sender_config_.width, video_sender_config_.height, send_time); |
782 | 780 |
783 frame_receiver_->GetRawVideoFrame( | 781 frame_receiver_->GetRawVideoFrame( |
784 base::Bind(&TestReceiverVideoCallback::CheckVideoFrame, | 782 base::Bind(&TestReceiverVideoCallback::CheckVideoFrame, |
785 test_receiver_video_callback_)); | 783 test_receiver_video_callback_)); |
786 | 784 |
787 RunTasks(2 * kFrameTimerMs + 1); // Empty the receiver pipeline. | 785 RunTasks(2 * kFrameTimerMs + 1); // Empty the receiver pipeline. |
788 EXPECT_EQ(2, test_receiver_video_callback_->number_times_called()); | 786 EXPECT_EQ(2, test_receiver_video_callback_->number_times_called()); |
789 } | 787 } |
790 | 788 |
791 TEST_F(End2EndTest, DropEveryOtherFrame3Buffers) { | 789 TEST_F(End2EndTest, DropEveryOtherFrame3Buffers) { |
792 SetupConfig(transport::kOpus, kDefaultAudioSamplingRate, false, 3); | 790 SetupConfig(transport::kOpus, kDefaultAudioSamplingRate, false, 3); |
793 video_sender_config_.rtp_max_delay_ms = 67; | 791 video_sender_config_.rtp_max_delay_ms = 67; |
794 video_receiver_config_.rtp_max_delay_ms = 67; | 792 video_receiver_config_.rtp_max_delay_ms = 67; |
795 Create(); | 793 Create(); |
796 sender_to_receiver_.DropAllPacketsBelongingToOddFrames(); | 794 sender_to_receiver_.DropAllPacketsBelongingToOddFrames(); |
797 | 795 |
798 int video_start = 50; | 796 int video_start = 50; |
799 base::TimeTicks send_time; | 797 base::TimeTicks send_time; |
800 | 798 |
801 int i = 0; | 799 int i = 0; |
802 for (; i < 20; ++i) { | 800 for (; i < 20; ++i) { |
803 send_time = testing_clock_.NowTicks(); | 801 send_time = testing_clock_->NowTicks(); |
804 SendVideoFrame(video_start, send_time); | 802 SendVideoFrame(video_start, send_time); |
805 | 803 |
806 if (i % 2 == 0) { | 804 if (i % 2 == 0) { |
807 test_receiver_video_callback_->AddExpectedResult(video_start, | 805 test_receiver_video_callback_->AddExpectedResult(video_start, |
808 video_sender_config_.width, video_sender_config_.height, send_time); | 806 video_sender_config_.width, video_sender_config_.height, send_time); |
809 | 807 |
810 // GetRawVideoFrame will not return the frame until we are close in | 808 // GetRawVideoFrame will not return the frame until we are close in |
811 // time before we should render the frame. | 809 // time before we should render the frame. |
812 frame_receiver_->GetRawVideoFrame( | 810 frame_receiver_->GetRawVideoFrame( |
813 base::Bind(&TestReceiverVideoCallback::CheckVideoFrame, | 811 base::Bind(&TestReceiverVideoCallback::CheckVideoFrame, |
814 test_receiver_video_callback_)); | 812 test_receiver_video_callback_)); |
815 } | 813 } |
816 RunTasks(kFrameTimerMs); | 814 RunTasks(kFrameTimerMs); |
817 video_start++; | 815 video_start++; |
818 } | 816 } |
819 std::cout << std::endl; | 817 std::cout << std::endl; |
820 RunTasks(2 * kFrameTimerMs + 1); // Empty the pipeline. | 818 RunTasks(2 * kFrameTimerMs + 1); // Empty the pipeline. |
821 EXPECT_EQ(i / 2, test_receiver_video_callback_->number_times_called()); | 819 EXPECT_EQ(i / 2, test_receiver_video_callback_->number_times_called()); |
822 } | 820 } |
823 | 821 |
824 TEST_F(End2EndTest, ResetReferenceFrameId) { | 822 TEST_F(End2EndTest, ResetReferenceFrameId) { |
825 SetupConfig(transport::kOpus, kDefaultAudioSamplingRate, false, 3); | 823 SetupConfig(transport::kOpus, kDefaultAudioSamplingRate, false, 3); |
826 video_sender_config_.rtp_max_delay_ms = 67; | 824 video_sender_config_.rtp_max_delay_ms = 67; |
827 video_receiver_config_.rtp_max_delay_ms = 67; | 825 video_receiver_config_.rtp_max_delay_ms = 67; |
828 Create(); | 826 Create(); |
829 sender_to_receiver_.AlwaysResetReferenceFrameId(); | 827 sender_to_receiver_.AlwaysResetReferenceFrameId(); |
830 | 828 |
831 int frames_counter = 0; | 829 int frames_counter = 0; |
832 for (; frames_counter < 20; ++frames_counter) { | 830 for (; frames_counter < 20; ++frames_counter) { |
833 const base::TimeTicks send_time = testing_clock_.NowTicks(); | 831 const base::TimeTicks send_time = testing_clock_->NowTicks(); |
834 SendVideoFrame(frames_counter, send_time); | 832 SendVideoFrame(frames_counter, send_time); |
835 | 833 |
836 test_receiver_video_callback_->AddExpectedResult(frames_counter, | 834 test_receiver_video_callback_->AddExpectedResult(frames_counter, |
837 video_sender_config_.width, video_sender_config_.height, send_time); | 835 video_sender_config_.width, video_sender_config_.height, send_time); |
838 | 836 |
839 // GetRawVideoFrame will not return the frame until we are close to the | 837 // GetRawVideoFrame will not return the frame until we are close to the |
840 // time in which we should render the frame. | 838 // time in which we should render the frame. |
841 frame_receiver_->GetRawVideoFrame( | 839 frame_receiver_->GetRawVideoFrame( |
842 base::Bind(&TestReceiverVideoCallback::CheckVideoFrame, | 840 base::Bind(&TestReceiverVideoCallback::CheckVideoFrame, |
843 test_receiver_video_callback_)); | 841 test_receiver_video_callback_)); |
(...skipping 12 matching lines...) Expand all Loading... |
856 transport_config_.aes_key = | 854 transport_config_.aes_key = |
857 ConvertFromBase16String("deadbeefcafeb0b0b0b0cafedeadbeef"); | 855 ConvertFromBase16String("deadbeefcafeb0b0b0b0cafedeadbeef"); |
858 | 856 |
859 video_receiver_config_.aes_iv_mask = transport_config_.aes_iv_mask; | 857 video_receiver_config_.aes_iv_mask = transport_config_.aes_iv_mask; |
860 video_receiver_config_.aes_key = transport_config_.aes_key; | 858 video_receiver_config_.aes_key = transport_config_.aes_key; |
861 | 859 |
862 Create(); | 860 Create(); |
863 | 861 |
864 int frames_counter = 0; | 862 int frames_counter = 0; |
865 for (; frames_counter < 3; ++frames_counter) { | 863 for (; frames_counter < 3; ++frames_counter) { |
866 const base::TimeTicks send_time = testing_clock_.NowTicks(); | 864 const base::TimeTicks send_time = testing_clock_->NowTicks(); |
867 | 865 |
868 SendVideoFrame(frames_counter, send_time); | 866 SendVideoFrame(frames_counter, send_time); |
869 | 867 |
870 test_receiver_video_callback_->AddExpectedResult(frames_counter, | 868 test_receiver_video_callback_->AddExpectedResult(frames_counter, |
871 video_sender_config_.width, video_sender_config_.height, send_time); | 869 video_sender_config_.width, video_sender_config_.height, send_time); |
872 | 870 |
873 // GetRawVideoFrame will not return the frame until we are close to the | 871 // GetRawVideoFrame will not return the frame until we are close to the |
874 // time in which we should render the frame. | 872 // time in which we should render the frame. |
875 frame_receiver_->GetRawVideoFrame( | 873 frame_receiver_->GetRawVideoFrame( |
876 base::Bind(&TestReceiverVideoCallback::CheckVideoFrame, | 874 base::Bind(&TestReceiverVideoCallback::CheckVideoFrame, |
(...skipping 21 matching lines...) Expand all Loading... |
898 | 896 |
899 audio_receiver_config_.aes_iv_mask = transport_config_.aes_iv_mask; | 897 audio_receiver_config_.aes_iv_mask = transport_config_.aes_iv_mask; |
900 audio_receiver_config_.aes_key = transport_config_.aes_key; | 898 audio_receiver_config_.aes_key = transport_config_.aes_key; |
901 | 899 |
902 Create(); | 900 Create(); |
903 | 901 |
904 int frames_counter = 0; | 902 int frames_counter = 0; |
905 for (; frames_counter < 3; ++frames_counter) { | 903 for (; frames_counter < 3; ++frames_counter) { |
906 int num_10ms_blocks = 2; | 904 int num_10ms_blocks = 2; |
907 | 905 |
908 const base::TimeTicks send_time = testing_clock_.NowTicks(); | 906 const base::TimeTicks send_time = testing_clock_->NowTicks(); |
909 | 907 |
910 scoped_ptr<AudioBus> audio_bus(audio_bus_factory_->NextAudioBus( | 908 scoped_ptr<AudioBus> audio_bus(audio_bus_factory_->NextAudioBus( |
911 base::TimeDelta::FromMilliseconds(10) * num_10ms_blocks)); | 909 base::TimeDelta::FromMilliseconds(10) * num_10ms_blocks)); |
912 | 910 |
913 if (frames_counter != 0) { | 911 if (frames_counter != 0) { |
914 // Due to the re-sampler and NetEq in the webrtc AudioCodingModule the | 912 // Due to the re-sampler and NetEq in the webrtc AudioCodingModule the |
915 // first samples will be 0 and then slowly ramp up to its real amplitude; | 913 // first samples will be 0 and then slowly ramp up to its real amplitude; |
916 // ignore the first frame. | 914 // ignore the first frame. |
917 test_receiver_audio_callback_->AddExpectedResult( | 915 test_receiver_audio_callback_->AddExpectedResult( |
918 ToPcmAudioFrame(*audio_bus, audio_sender_config_.frequency), | 916 ToPcmAudioFrame(*audio_bus, audio_sender_config_.frequency), |
(...skipping 24 matching lines...) Expand all Loading... |
943 | 941 |
944 // Video test without packet loss; This test is targeted at testing the logging | 942 // Video test without packet loss; This test is targeted at testing the logging |
945 // aspects of the end2end, but is basically equivalent to LoopNoLossPcm16. | 943 // aspects of the end2end, but is basically equivalent to LoopNoLossPcm16. |
946 TEST_F(End2EndTest, VideoLogging) { | 944 TEST_F(End2EndTest, VideoLogging) { |
947 SetupConfig(transport::kPcm16, 32000, false, 1); | 945 SetupConfig(transport::kPcm16, 32000, false, 1); |
948 Create(); | 946 Create(); |
949 | 947 |
950 int video_start = 1; | 948 int video_start = 1; |
951 int i = 0; | 949 int i = 0; |
952 for (; i < 1; ++i) { | 950 for (; i < 1; ++i) { |
953 base::TimeTicks send_time = testing_clock_.NowTicks(); | 951 base::TimeTicks send_time = testing_clock_->NowTicks(); |
954 test_receiver_video_callback_->AddExpectedResult(video_start, | 952 test_receiver_video_callback_->AddExpectedResult(video_start, |
955 video_sender_config_.width, video_sender_config_.height, send_time); | 953 video_sender_config_.width, video_sender_config_.height, send_time); |
956 | 954 |
957 SendVideoFrame(video_start, send_time); | 955 SendVideoFrame(video_start, send_time); |
958 RunTasks(kFrameTimerMs); | 956 RunTasks(kFrameTimerMs); |
959 | 957 |
960 frame_receiver_->GetRawVideoFrame( | 958 frame_receiver_->GetRawVideoFrame( |
961 base::Bind(&TestReceiverVideoCallback::CheckVideoFrame, | 959 base::Bind(&TestReceiverVideoCallback::CheckVideoFrame, |
962 test_receiver_video_callback_)); | 960 test_receiver_video_callback_)); |
963 | 961 |
964 video_start++; | 962 video_start++; |
965 } | 963 } |
966 | 964 |
967 // Basic tests. | 965 // Basic tests. |
968 RunTasks(2 * kFrameTimerMs + 1); // Empty the receiver pipeline. | 966 RunTasks(2 * kFrameTimerMs + 1); // Empty the receiver pipeline. |
969 EXPECT_EQ(i, test_receiver_video_callback_->number_times_called()); | 967 EXPECT_EQ(i, test_receiver_video_callback_->number_times_called()); |
970 | 968 |
971 // Sender logging tests. | 969 // Sender logging tests. |
972 LoggingImpl* sender_log = cast_environment_sender_->Logging(); | 970 LoggingImpl* sender_log = cast_environment_->Logging(); |
973 | 971 |
974 // Verify that all frames and all required events were logged. | 972 // Verify that all frames and all required events were logged. |
975 FrameRawMap frame_raw_log = sender_log->GetFrameRawData(); | 973 FrameRawMap frame_raw_log = sender_log->GetFrameRawData(); |
976 | 974 |
977 // Every frame should have only one entry. | 975 // Every frame should have only one entry. |
978 EXPECT_EQ(static_cast<unsigned int>(i), frame_raw_log.size()); | 976 EXPECT_EQ(static_cast<unsigned int>(i), frame_raw_log.size()); |
979 FrameRawMap::const_iterator frame_it = frame_raw_log.begin(); | 977 FrameRawMap::const_iterator frame_it = frame_raw_log.begin(); |
980 | 978 |
981 // Choose a video frame, and verify that all events were logged. | 979 // Choose a video frame, and verify that all events were logged. |
982 std::vector<CastLoggingEvent> event_log = frame_it->second.type; | 980 std::vector<CastLoggingEvent> event_log = frame_it->second.type; |
(...skipping 29 matching lines...) Expand all Loading... |
1012 // Packet logging. | 1010 // Packet logging. |
1013 // Verify that all packet related events were logged. | 1011 // Verify that all packet related events were logged. |
1014 PacketRawMap packet_raw_log = sender_log->GetPacketRawData(); | 1012 PacketRawMap packet_raw_log = sender_log->GetPacketRawData(); |
1015 // Every rtp_timestamp should have only one entry. | 1013 // Every rtp_timestamp should have only one entry. |
1016 EXPECT_EQ(static_cast<unsigned int>(i), packet_raw_log.size()); | 1014 EXPECT_EQ(static_cast<unsigned int>(i), packet_raw_log.size()); |
1017 PacketRawMap::const_iterator packet_it = packet_raw_log.begin(); | 1015 PacketRawMap::const_iterator packet_it = packet_raw_log.begin(); |
1018 // Choose a packet, and verify that all events were logged. | 1016 // Choose a packet, and verify that all events were logged. |
1019 event_log = (++(packet_it->second.packet_map.begin()))->second.type; | 1017 event_log = (++(packet_it->second.packet_map.begin()))->second.type; |
1020 EXPECT_TRUE((std::find(event_log.begin(), event_log.end(), | 1018 EXPECT_TRUE((std::find(event_log.begin(), event_log.end(), |
1021 kVideoPacketReceived)) != event_log.end()); | 1019 kVideoPacketReceived)) != event_log.end()); |
1022 // Verify that there were no other events logged with respect to this frame. | |
1023 EXPECT_EQ(1u, event_log.size()); | |
1024 | 1020 |
1025 RunTasks(750); // Make sure that we send a RTCP message with the log. | 1021 RunTasks(750); // Make sure that we send a RTCP message with the log. |
1026 | 1022 |
1027 // Receiver logging tests. | 1023 // Receiver logging tests. |
1028 LoggingImpl* receiver_log = cast_environment_receiver_->Logging(); | 1024 LoggingImpl* receiver_log = cast_environment_->Logging(); |
1029 | 1025 |
1030 // Verify that all frames and all required events were logged. | 1026 // Verify that all frames and all required events were logged. |
1031 frame_raw_log = receiver_log->GetFrameRawData(); | 1027 frame_raw_log = receiver_log->GetFrameRawData(); |
1032 EXPECT_EQ(static_cast<unsigned int>(i), frame_raw_log.size()); | 1028 EXPECT_EQ(static_cast<unsigned int>(i), frame_raw_log.size()); |
1033 frame_it = frame_raw_log.begin(); | 1029 frame_it = frame_raw_log.begin(); |
1034 | 1030 |
1035 // Choose a video frame, and verify that all events were logged. | 1031 // Choose a video frame, and verify that all events were logged. |
1036 event_log = frame_it->second.type; | 1032 event_log = frame_it->second.type; |
1037 | 1033 |
1038 event_it = std::find(event_log.begin(), event_log.end(), | 1034 event_it = std::find(event_log.begin(), event_log.end(), |
1039 kVideoFrameEncoded); | 1035 kVideoFrameEncoded); |
1040 EXPECT_TRUE(event_it != event_log.end()); | 1036 EXPECT_TRUE(event_it != event_log.end()); |
1041 | 1037 |
1042 event_it = std::find(event_log.begin(), event_log.end(), | 1038 event_it = std::find(event_log.begin(), event_log.end(), |
1043 kVideoRenderDelay); | 1039 kVideoRenderDelay); |
1044 | 1040 |
1045 EXPECT_TRUE(event_it != event_log.end()); | 1041 EXPECT_TRUE(event_it != event_log.end()); |
1046 EXPECT_EQ(2u, event_log.size()); | |
1047 } | 1042 } |
1048 | 1043 |
1049 // TODO(mikhal): Crashes on the bots. Re-enable. http://crbug.com/329563 | 1044 // TODO(mikhal): Crashes on the bots. Re-enable. http://crbug.com/329563 |
1050 #if defined(OS_WIN) | 1045 #if defined(OS_WIN) |
1051 #define MAYBE_AudioLogging DISABLED_AudioLogging | 1046 #define MAYBE_AudioLogging DISABLED_AudioLogging |
1052 #else | 1047 #else |
1053 #define MAYBE_AudioLogging AudioLogging | 1048 #define MAYBE_AudioLogging AudioLogging |
1054 #endif | 1049 #endif |
1055 // Audio test without packet loss; This test is targeted at testing the logging | 1050 // Audio test without packet loss; This test is targeted at testing the logging |
1056 // aspects of the end2end, but is basically equivalent to LoopNoLossPcm16. | 1051 // aspects of the end2end, but is basically equivalent to LoopNoLossPcm16. |
1057 TEST_F(End2EndTest, MAYBE_AudioLogging) { | 1052 TEST_F(End2EndTest, MAYBE_AudioLogging) { |
1058 SetupConfig(transport::kPcm16, 32000, false, 1); | 1053 SetupConfig(transport::kPcm16, 32000, false, 1); |
1059 Create(); | 1054 Create(); |
1060 | 1055 |
1061 int audio_diff = kFrameTimerMs; | 1056 int audio_diff = kFrameTimerMs; |
1062 int i = 0; | 1057 int i = 0; |
1063 | 1058 |
1064 for (; i < 10; ++i) { | 1059 for (; i < 10; ++i) { |
1065 int num_10ms_blocks = audio_diff / 10; | 1060 int num_10ms_blocks = audio_diff / 10; |
1066 audio_diff -= num_10ms_blocks * 10; | 1061 audio_diff -= num_10ms_blocks * 10; |
1067 base::TimeTicks send_time = testing_clock_.NowTicks(); | 1062 base::TimeTicks send_time = testing_clock_->NowTicks(); |
1068 | 1063 |
1069 scoped_ptr<AudioBus> audio_bus(audio_bus_factory_->NextAudioBus( | 1064 scoped_ptr<AudioBus> audio_bus(audio_bus_factory_->NextAudioBus( |
1070 base::TimeDelta::FromMilliseconds(10) * num_10ms_blocks)); | 1065 base::TimeDelta::FromMilliseconds(10) * num_10ms_blocks)); |
1071 | 1066 |
1072 if (i != 0) { | 1067 if (i != 0) { |
1073 // Due to the re-sampler and NetEq in the webrtc AudioCodingModule the | 1068 // Due to the re-sampler and NetEq in the webrtc AudioCodingModule the |
1074 // first samples will be 0 and then slowly ramp up to its real amplitude; | 1069 // first samples will be 0 and then slowly ramp up to its real amplitude; |
1075 // ignore the first frame. | 1070 // ignore the first frame. |
1076 test_receiver_audio_callback_->AddExpectedResult( | 1071 test_receiver_audio_callback_->AddExpectedResult( |
1077 ToPcmAudioFrame(*audio_bus, audio_sender_config_.frequency), | 1072 ToPcmAudioFrame(*audio_bus, audio_sender_config_.frequency), |
(...skipping 18 matching lines...) Expand all Loading... |
1096 base::Bind(&TestReceiverAudioCallback::CheckPcmAudioFrame, | 1091 base::Bind(&TestReceiverAudioCallback::CheckPcmAudioFrame, |
1097 test_receiver_audio_callback_)); | 1092 test_receiver_audio_callback_)); |
1098 } | 1093 } |
1099 } | 1094 } |
1100 | 1095 |
1101 // Basic tests. | 1096 // Basic tests. |
1102 RunTasks(2 * kFrameTimerMs + 1); // Empty the receiver pipeline. | 1097 RunTasks(2 * kFrameTimerMs + 1); // Empty the receiver pipeline. |
1103 //EXPECT_EQ(i - 1, test_receiver_audio_callback_->number_times_called()); | 1098 //EXPECT_EQ(i - 1, test_receiver_audio_callback_->number_times_called()); |
1104 EXPECT_EQ(i - 1, test_receiver_audio_callback_->number_times_called()); | 1099 EXPECT_EQ(i - 1, test_receiver_audio_callback_->number_times_called()); |
1105 // Logging tests. | 1100 // Logging tests. |
1106 LoggingImpl* sender_log = cast_environment_sender_->Logging(); | 1101 LoggingImpl* sender_log = cast_environment_->Logging(); |
1107 // Verify that all frames and all required events were logged. | 1102 // Verify that all frames and all required events were logged. |
1108 FrameRawMap frame_raw_log = sender_log->GetFrameRawData(); | 1103 FrameRawMap frame_raw_log = sender_log->GetFrameRawData(); |
1109 // TODO(mikhal): Results are wrong. Need to resolve passing/calculation of | 1104 // TODO(mikhal): Results are wrong. Need to resolve passing/calculation of |
1110 // rtp_timestamp for audio for this to work. | 1105 // rtp_timestamp for audio for this to work. |
1111 // Should have logged both audio and video. Every frame should have only one | 1106 // Should have logged both audio and video. Every frame should have only one |
1112 // entry. | 1107 // entry. |
1113 //EXPECT_EQ(static_cast<unsigned int>(i - 1), frame_raw_log.size()); | 1108 //EXPECT_EQ(static_cast<unsigned int>(i - 1), frame_raw_log.size()); |
1114 FrameRawMap::const_iterator frame_it = frame_raw_log.begin(); | 1109 FrameRawMap::const_iterator frame_it = frame_raw_log.begin(); |
1115 // Choose a video frame, and verify that all events were logged. | 1110 // Choose a video frame, and verify that all events were logged. |
1116 std::vector<CastLoggingEvent> event_log = frame_it->second.type; | 1111 std::vector<CastLoggingEvent> event_log = frame_it->second.type; |
(...skipping 11 matching lines...) Expand all Loading... |
1128 } | 1123 } |
1129 | 1124 |
1130 | 1125 |
1131 // TODO(pwestin): Add repeatable packet loss test. | 1126 // TODO(pwestin): Add repeatable packet loss test. |
1132 // TODO(pwestin): Add test for misaligned send get calls. | 1127 // TODO(pwestin): Add test for misaligned send get calls. |
1133 // TODO(pwestin): Add more tests that does not resample. | 1128 // TODO(pwestin): Add more tests that does not resample. |
1134 // TODO(pwestin): Add test when we have starvation for our RunTask. | 1129 // TODO(pwestin): Add test when we have starvation for our RunTask. |
1135 | 1130 |
1136 } // namespace cast | 1131 } // namespace cast |
1137 } // namespace media | 1132 } // namespace media |
OLD | NEW |