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/test/simple_test_tick_clock.h" | 5 #include "base/test/simple_test_tick_clock.h" |
6 #include "media/cast/audio_receiver/audio_decoder.h" | 6 #include "media/cast/audio_receiver/audio_decoder.h" |
7 #include "media/cast/cast_environment.h" | 7 #include "media/cast/cast_environment.h" |
8 #include "media/cast/test/fake_single_thread_task_runner.h" | 8 #include "media/cast/test/fake_single_thread_task_runner.h" |
9 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 class AudioDecoderTest : public ::testing::Test { | 27 class AudioDecoderTest : public ::testing::Test { |
28 protected: | 28 protected: |
29 AudioDecoderTest() { | 29 AudioDecoderTest() { |
30 testing_clock_ = new base::SimpleTestTickClock(); | 30 testing_clock_ = new base::SimpleTestTickClock(); |
31 testing_clock_->Advance(base::TimeDelta::FromMilliseconds(1234)); | 31 testing_clock_->Advance(base::TimeDelta::FromMilliseconds(1234)); |
32 task_runner_ = new test::FakeSingleThreadTaskRunner(testing_clock_); | 32 task_runner_ = new test::FakeSingleThreadTaskRunner(testing_clock_); |
33 cast_environment_ = | 33 cast_environment_ = |
34 new CastEnvironment(scoped_ptr<base::TickClock>(testing_clock_).Pass(), | 34 new CastEnvironment(scoped_ptr<base::TickClock>(testing_clock_).Pass(), |
35 task_runner_, | 35 task_runner_, |
36 task_runner_, | 36 task_runner_, |
37 task_runner_, | 37 task_runner_); |
38 GetDefaultCastReceiverLoggingConfig()); | |
39 } | 38 } |
40 virtual ~AudioDecoderTest() {} | 39 virtual ~AudioDecoderTest() {} |
41 | 40 |
42 void Configure(const AudioReceiverConfig& audio_config) { | 41 void Configure(const AudioReceiverConfig& audio_config) { |
43 audio_decoder_.reset( | 42 audio_decoder_.reset( |
44 new AudioDecoder(cast_environment_, audio_config, &cast_feedback_)); | 43 new AudioDecoder(cast_environment_, audio_config, &cast_feedback_)); |
45 } | 44 } |
46 | 45 |
47 TestRtpPayloadFeedback cast_feedback_; | 46 TestRtpPayloadFeedback cast_feedback_; |
48 // Owned by CastEnvironment. | 47 // Owned by CastEnvironment. |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 for (size_t i = 100 * audio_config.channels; i < audio_frame.samples.size(); | 208 for (size_t i = 100 * audio_config.channels; i < audio_frame.samples.size(); |
210 ++i) { | 209 ++i) { |
211 EXPECT_NEAR(0x3412, audio_frame.samples[i], 400); | 210 EXPECT_NEAR(0x3412, audio_frame.samples[i], 400); |
212 if (0x3412 == audio_frame.samples[i]) | 211 if (0x3412 == audio_frame.samples[i]) |
213 count++; | 212 count++; |
214 } | 213 } |
215 } | 214 } |
216 | 215 |
217 } // namespace cast | 216 } // namespace cast |
218 } // namespace media | 217 } // namespace media |
OLD | NEW |