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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 } | 83 } |
84 } | 84 } |
85 return true; | 85 return true; |
86 } | 86 } |
87 | 87 |
88 // blink::WebAudioSourceProviderClient implementation. | 88 // blink::WebAudioSourceProviderClient implementation. |
89 MOCK_METHOD2(setFormat, void(size_t numberOfChannels, float sampleRate)); | 89 MOCK_METHOD2(setFormat, void(size_t numberOfChannels, float sampleRate)); |
90 | 90 |
91 // CopyAudioCB. Added forwarder method due to GMock troubles with scoped_ptr. | 91 // CopyAudioCB. Added forwarder method due to GMock troubles with scoped_ptr. |
92 MOCK_METHOD3(DoCopyAudioCB, | 92 MOCK_METHOD3(DoCopyAudioCB, |
93 void(AudioBus*, uint32_t delay_milliseconds, int sample_rate)); | 93 void(AudioBus*, uint32_t frames_delayed, int sample_rate)); |
94 void OnAudioBus(std::unique_ptr<AudioBus> bus, | 94 void OnAudioBus(std::unique_ptr<AudioBus> bus, |
95 uint32_t delay_milliseconds, | 95 uint32_t frames_delayed, |
96 int sample_rate) { | 96 int sample_rate) { |
97 DoCopyAudioCB(bus.get(), delay_milliseconds, sample_rate); | 97 DoCopyAudioCB(bus.get(), frames_delayed, sample_rate); |
98 } | 98 } |
99 | 99 |
100 int Render(AudioBus* audio_bus) { | 100 int Render(AudioBus* audio_bus) { |
101 return wasp_impl_->RenderForTesting(audio_bus); | 101 return wasp_impl_->RenderForTesting(audio_bus); |
102 } | 102 } |
103 | 103 |
104 protected: | 104 protected: |
105 AudioParameters params_; | 105 AudioParameters params_; |
106 FakeAudioRenderCallback fake_callback_; | 106 FakeAudioRenderCallback fake_callback_; |
107 scoped_refptr<MockAudioRendererSink> mock_sink_; | 107 scoped_refptr<MockAudioRendererSink> mock_sink_; |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 Render(bus1.get()); | 267 Render(bus1.get()); |
268 | 268 |
269 wasp_impl_->ClearCopyAudioCallback(); | 269 wasp_impl_->ClearCopyAudioCallback(); |
270 EXPECT_CALL(*this, DoCopyAudioCB(_, _, _)).Times(0); | 270 EXPECT_CALL(*this, DoCopyAudioCB(_, _, _)).Times(0); |
271 Render(bus1.get()); | 271 Render(bus1.get()); |
272 | 272 |
273 testing::Mock::VerifyAndClear(mock_sink_.get()); | 273 testing::Mock::VerifyAndClear(mock_sink_.get()); |
274 } | 274 } |
275 | 275 |
276 } // namespace media | 276 } // namespace media |
OLD | NEW |