| 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 #include "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/test/simple_test_tick_clock.h" | 8 #include "base/test/simple_test_tick_clock.h" |
| 9 #include "media/base/media.h" | 9 #include "media/base/media.h" |
| 10 #include "media/cast/audio_sender/audio_sender.h" | 10 #include "media/cast/audio_sender/audio_sender.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 protected: | 27 protected: |
| 28 AudioSenderTest() { | 28 AudioSenderTest() { |
| 29 InitializeMediaLibraryForTesting(); | 29 InitializeMediaLibraryForTesting(); |
| 30 testing_clock_.Advance( | 30 testing_clock_.Advance( |
| 31 base::TimeDelta::FromMilliseconds(kStartMillisecond)); | 31 base::TimeDelta::FromMilliseconds(kStartMillisecond)); |
| 32 } | 32 } |
| 33 | 33 |
| 34 virtual void SetUp() { | 34 virtual void SetUp() { |
| 35 task_runner_ = new test::FakeTaskRunner(&testing_clock_); | 35 task_runner_ = new test::FakeTaskRunner(&testing_clock_); |
| 36 cast_environment_ = new CastEnvironment(&testing_clock_, task_runner_, | 36 cast_environment_ = new CastEnvironment(&testing_clock_, task_runner_, |
| 37 task_runner_, task_runner_, task_runner_, task_runner_); | 37 task_runner_, task_runner_, task_runner_, task_runner_, |
| 38 false, false, false); |
| 38 audio_config_.codec = kOpus; | 39 audio_config_.codec = kOpus; |
| 39 audio_config_.use_external_encoder = false; | 40 audio_config_.use_external_encoder = false; |
| 40 audio_config_.frequency = kDefaultAudioSamplingRate; | 41 audio_config_.frequency = kDefaultAudioSamplingRate; |
| 41 audio_config_.channels = 2; | 42 audio_config_.channels = 2; |
| 42 audio_config_.bitrate = kDefaultAudioEncoderBitrate; | 43 audio_config_.bitrate = kDefaultAudioEncoderBitrate; |
| 43 audio_config_.rtp_payload_type = 127; | 44 audio_config_.rtp_payload_type = 127; |
| 44 | 45 |
| 45 audio_sender_.reset( | 46 audio_sender_.reset( |
| 46 new AudioSender(cast_environment_, audio_config_, &mock_transport_)); | 47 new AudioSender(cast_environment_, audio_config_, &mock_transport_)); |
| 47 } | 48 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 80 |
| 80 // Make sure that we send at least one RTCP packet. | 81 // Make sure that we send at least one RTCP packet. |
| 81 base::TimeDelta max_rtcp_timeout = | 82 base::TimeDelta max_rtcp_timeout = |
| 82 base::TimeDelta::FromMilliseconds(1 + kDefaultRtcpIntervalMs * 3 / 2); | 83 base::TimeDelta::FromMilliseconds(1 + kDefaultRtcpIntervalMs * 3 / 2); |
| 83 testing_clock_.Advance(max_rtcp_timeout); | 84 testing_clock_.Advance(max_rtcp_timeout); |
| 84 task_runner_->RunTasks(); | 85 task_runner_->RunTasks(); |
| 85 } | 86 } |
| 86 | 87 |
| 87 } // namespace cast | 88 } // namespace cast |
| 88 } // namespace media | 89 } // namespace media |
| OLD | NEW |