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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 frame_input_ = cast_sender_->frame_input(); | 451 frame_input_ = cast_sender_->frame_input(); |
452 frame_receiver_ = cast_receiver_->frame_receiver(); | 452 frame_receiver_ = cast_receiver_->frame_receiver(); |
453 | 453 |
454 audio_bus_factory_.reset(new TestAudioBusFactory( | 454 audio_bus_factory_.reset(new TestAudioBusFactory( |
455 audio_sender_config_.channels, audio_sender_config_.frequency, | 455 audio_sender_config_.channels, audio_sender_config_.frequency, |
456 kSoundFrequency, kSoundVolume)); | 456 kSoundFrequency, kSoundVolume)); |
457 } | 457 } |
458 | 458 |
459 virtual ~End2EndTest() {} | 459 virtual ~End2EndTest() {} |
460 | 460 |
461 virtual void TearDown() OVERRIDE { | |
462 cast_sender_.reset(); | |
463 cast_receiver_.reset(); | |
464 task_runner_->RunTasks(); | |
465 } | |
466 | |
467 void SendVideoFrame(int start_value, const base::TimeTicks& capture_time) { | 461 void SendVideoFrame(int start_value, const base::TimeTicks& capture_time) { |
468 if (start_time_.is_null()) | 462 if (start_time_.is_null()) |
469 start_time_ = testing_clock_.NowTicks(); | 463 start_time_ = testing_clock_.NowTicks(); |
470 start_time_ = testing_clock_.NowTicks(); | 464 start_time_ = testing_clock_.NowTicks(); |
471 base::TimeDelta time_diff = testing_clock_.NowTicks() - start_time_; | 465 base::TimeDelta time_diff = testing_clock_.NowTicks() - start_time_; |
472 gfx::Size size(kVideoWidth, kVideoHeight); | 466 gfx::Size size(kVideoWidth, kVideoHeight); |
473 EXPECT_TRUE(VideoFrame::IsValidConfig(VideoFrame::I420, | 467 EXPECT_TRUE(VideoFrame::IsValidConfig(VideoFrame::I420, |
474 size, gfx::Rect(size), size)); | 468 size, gfx::Rect(size), size)); |
475 scoped_refptr<media::VideoFrame> video_frame = | 469 scoped_refptr<media::VideoFrame> video_frame = |
476 media::VideoFrame::CreateFrame( | 470 media::VideoFrame::CreateFrame( |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1134 } | 1128 } |
1135 | 1129 |
1136 | 1130 |
1137 // TODO(pwestin): Add repeatable packet loss test. | 1131 // TODO(pwestin): Add repeatable packet loss test. |
1138 // TODO(pwestin): Add test for misaligned send get calls. | 1132 // TODO(pwestin): Add test for misaligned send get calls. |
1139 // TODO(pwestin): Add more tests that does not resample. | 1133 // TODO(pwestin): Add more tests that does not resample. |
1140 // TODO(pwestin): Add test when we have starvation for our RunTask. | 1134 // TODO(pwestin): Add test when we have starvation for our RunTask. |
1141 | 1135 |
1142 } // namespace cast | 1136 } // namespace cast |
1143 } // namespace media | 1137 } // namespace media |
OLD | NEW |