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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 std::list<ExpectedVideoFrame> expected_frame_; | 322 std::list<ExpectedVideoFrame> expected_frame_; |
323 }; | 323 }; |
324 | 324 |
325 // The actual test class, generate synthetic data for both audio and video and | 325 // The actual test class, generate synthetic data for both audio and video and |
326 // send those through the sender and receiver and analyzes the result. | 326 // send those through the sender and receiver and analyzes the result. |
327 class End2EndTest : public ::testing::Test { | 327 class End2EndTest : public ::testing::Test { |
328 protected: | 328 protected: |
329 End2EndTest() | 329 End2EndTest() |
330 : task_runner_(new test::FakeTaskRunner(&testing_clock_)), | 330 : task_runner_(new test::FakeTaskRunner(&testing_clock_)), |
331 cast_environment_(new CastEnvironment(&testing_clock_, task_runner_, | 331 cast_environment_(new CastEnvironment(&testing_clock_, task_runner_, |
332 task_runner_, task_runner_, task_runner_, task_runner_)), | 332 task_runner_, task_runner_, task_runner_, task_runner_, |
| 333 GetDefaultCastLoggingConfig())), |
333 sender_to_receiver_(cast_environment_), | 334 sender_to_receiver_(cast_environment_), |
334 receiver_to_sender_(cast_environment_), | 335 receiver_to_sender_(cast_environment_), |
335 test_receiver_audio_callback_(new TestReceiverAudioCallback()), | 336 test_receiver_audio_callback_(new TestReceiverAudioCallback()), |
336 test_receiver_video_callback_(new TestReceiverVideoCallback()) { | 337 test_receiver_video_callback_(new TestReceiverVideoCallback()) { |
337 testing_clock_.Advance( | 338 testing_clock_.Advance( |
338 base::TimeDelta::FromMilliseconds(kStartMillisecond)); | 339 base::TimeDelta::FromMilliseconds(kStartMillisecond)); |
339 } | 340 } |
340 | 341 |
341 void SetupConfig(AudioCodec audio_codec, | 342 void SetupConfig(AudioCodec audio_codec, |
342 int audio_sampling_frequency, | 343 int audio_sampling_frequency, |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
872 test_receiver_audio_callback_->number_times_called()); | 873 test_receiver_audio_callback_->number_times_called()); |
873 } | 874 } |
874 | 875 |
875 // TODO(pwestin): Add repeatable packet loss test. | 876 // TODO(pwestin): Add repeatable packet loss test. |
876 // TODO(pwestin): Add test for misaligned send get calls. | 877 // TODO(pwestin): Add test for misaligned send get calls. |
877 // TODO(pwestin): Add more tests that does not resample. | 878 // TODO(pwestin): Add more tests that does not resample. |
878 // TODO(pwestin): Add test when we have starvation for our RunTask. | 879 // TODO(pwestin): Add test when we have starvation for our RunTask. |
879 | 880 |
880 } // namespace cast | 881 } // namespace cast |
881 } // namespace media | 882 } // namespace media |
OLD | NEW |