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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 std::list<ExpectedVideoFrame> expected_frame_; | 320 std::list<ExpectedVideoFrame> expected_frame_; |
321 }; | 321 }; |
322 | 322 |
323 // The actual test class, generate synthetic data for both audio and video and | 323 // The actual test class, generate synthetic data for both audio and video and |
324 // send those through the sender and receiver and analyzes the result. | 324 // send those through the sender and receiver and analyzes the result. |
325 class End2EndTest : public ::testing::Test { | 325 class End2EndTest : public ::testing::Test { |
326 protected: | 326 protected: |
327 End2EndTest() | 327 End2EndTest() |
328 : task_runner_(new test::FakeTaskRunner(&testing_clock_)), | 328 : task_runner_(new test::FakeTaskRunner(&testing_clock_)), |
329 cast_environment_(new CastEnvironment(&testing_clock_, task_runner_, | 329 cast_environment_(new CastEnvironment(&testing_clock_, task_runner_, |
330 task_runner_, task_runner_, task_runner_, task_runner_)), | 330 task_runner_, task_runner_, task_runner_, task_runner_, |
| 331 true, false, false)), |
331 sender_to_receiver_(cast_environment_), | 332 sender_to_receiver_(cast_environment_), |
332 receiver_to_sender_(cast_environment_), | 333 receiver_to_sender_(cast_environment_), |
333 test_receiver_audio_callback_(new TestReceiverAudioCallback()), | 334 test_receiver_audio_callback_(new TestReceiverAudioCallback()), |
334 test_receiver_video_callback_(new TestReceiverVideoCallback()) { | 335 test_receiver_video_callback_(new TestReceiverVideoCallback()) { |
335 testing_clock_.Advance( | 336 testing_clock_.Advance( |
336 base::TimeDelta::FromMilliseconds(kStartMillisecond)); | 337 base::TimeDelta::FromMilliseconds(kStartMillisecond)); |
337 } | 338 } |
338 | 339 |
339 void SetupConfig(AudioCodec audio_codec, | 340 void SetupConfig(AudioCodec audio_codec, |
340 int audio_sampling_frequency, | 341 int audio_sampling_frequency, |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 test_receiver_video_callback_->number_times_called()); | 784 test_receiver_video_callback_->number_times_called()); |
784 } | 785 } |
785 | 786 |
786 // TODO(pwestin): Add repeatable packet loss test. | 787 // TODO(pwestin): Add repeatable packet loss test. |
787 // TODO(pwestin): Add test for misaligned send get calls. | 788 // TODO(pwestin): Add test for misaligned send get calls. |
788 // TODO(pwestin): Add more tests that does not resample. | 789 // TODO(pwestin): Add more tests that does not resample. |
789 // TODO(pwestin): Add test when we have starvation for our RunTask. | 790 // TODO(pwestin): Add test when we have starvation for our RunTask. |
790 | 791 |
791 } // namespace cast | 792 } // namespace cast |
792 } // namespace media | 793 } // namespace media |
OLD | NEW |