OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "media/base/audio_renderer_mixer.h" | 7 #include "media/base/audio_renderer_mixer.h" |
8 #include "media/base/audio_renderer_mixer_input.h" | 8 #include "media/base/audio_renderer_mixer_input.h" |
9 #include "media/base/fake_audio_render_callback.h" | 9 #include "media/base/fake_audio_render_callback.h" |
10 #include "media/base/mock_audio_renderer_sink.h" | 10 #include "media/base/mock_audio_renderer_sink.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 mixer_.reset(new AudioRendererMixer( | 49 mixer_.reset(new AudioRendererMixer( |
50 audio_parameters_, audio_parameters_, sink)); | 50 audio_parameters_, audio_parameters_, sink)); |
51 } | 51 } |
52 return mixer_.get(); | 52 return mixer_.get(); |
53 } | 53 } |
54 | 54 |
55 double ProvideInput() { | 55 double ProvideInput() { |
56 return mixer_input_->ProvideInput(audio_bus_.get(), base::TimeDelta()); | 56 return mixer_input_->ProvideInput(audio_bus_.get(), base::TimeDelta()); |
57 } | 57 } |
58 | 58 |
59 int GetAudioDelayMilliseconds() { | |
60 return mixer_input_->current_audio_delay_milliseconds_; | |
61 } | |
62 | |
63 MOCK_METHOD1(RemoveMixer, void(const AudioParameters&)); | 59 MOCK_METHOD1(RemoveMixer, void(const AudioParameters&)); |
64 | 60 |
65 protected: | 61 protected: |
66 virtual ~AudioRendererMixerInputTest() {} | 62 virtual ~AudioRendererMixerInputTest() {} |
67 | 63 |
68 AudioParameters audio_parameters_; | 64 AudioParameters audio_parameters_; |
69 scoped_ptr<AudioRendererMixer> mixer_; | 65 scoped_ptr<AudioRendererMixer> mixer_; |
70 scoped_refptr<AudioRendererMixerInput> mixer_input_; | 66 scoped_refptr<AudioRendererMixerInput> mixer_input_; |
71 scoped_ptr<FakeAudioRenderCallback> fake_callback_; | 67 scoped_ptr<FakeAudioRenderCallback> fake_callback_; |
72 scoped_ptr<AudioBus> audio_bus_; | 68 scoped_ptr<AudioBus> audio_bus_; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 TEST_F(AudioRendererMixerInputTest, StopBeforeInitializeOrStart) { | 103 TEST_F(AudioRendererMixerInputTest, StopBeforeInitializeOrStart) { |
108 // |mixer_input_| was initialized during construction. | 104 // |mixer_input_| was initialized during construction. |
109 mixer_input_->Stop(); | 105 mixer_input_->Stop(); |
110 | 106 |
111 // Verify Stop() works without Initialize() or Start(). | 107 // Verify Stop() works without Initialize() or Start(). |
112 CreateMixerInput(); | 108 CreateMixerInput(); |
113 mixer_input_->Stop(); | 109 mixer_input_->Stop(); |
114 } | 110 } |
115 | 111 |
116 } // namespace media | 112 } // namespace media |
OLD | NEW |