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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "media/audio/audio_manager.h" | 9 #include "media/audio/audio_manager.h" |
10 #include "media/audio/audio_manager_base.h" | 10 #include "media/audio/audio_manager_base.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 private: | 122 private: |
123 media::FakeAudioLogFactory fake_audio_log_factory_; | 123 media::FakeAudioLogFactory fake_audio_log_factory_; |
124 }; | 124 }; |
125 | 125 |
126 class MockAudioSourceCallback : public AudioOutputStream::AudioSourceCallback { | 126 class MockAudioSourceCallback : public AudioOutputStream::AudioSourceCallback { |
127 public: | 127 public: |
128 int OnMoreData(AudioBus* audio_bus, AudioBuffersState buffers_state) { | 128 int OnMoreData(AudioBus* audio_bus, AudioBuffersState buffers_state) { |
129 audio_bus->Zero(); | 129 audio_bus->Zero(); |
130 return audio_bus->frames(); | 130 return audio_bus->frames(); |
131 } | 131 } |
132 int OnMoreIOData(AudioBus* source, AudioBus* dest, | |
133 AudioBuffersState buffers_state) { | |
134 return OnMoreData(dest, buffers_state); | |
135 } | |
136 MOCK_METHOD1(OnError, void(AudioOutputStream* stream)); | 132 MOCK_METHOD1(OnError, void(AudioOutputStream* stream)); |
137 }; | 133 }; |
138 | 134 |
139 } // namespace | 135 } // namespace |
140 | 136 |
141 namespace media { | 137 namespace media { |
142 | 138 |
143 class AudioOutputProxyTest : public testing::Test { | 139 class AudioOutputProxyTest : public testing::Test { |
144 protected: | 140 protected: |
145 virtual void SetUp() { | 141 virtual void SetUp() { |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 proxy1->Stop(); | 663 proxy1->Stop(); |
668 CloseAndWaitForCloseTimer(proxy1, &stream1); | 664 CloseAndWaitForCloseTimer(proxy1, &stream1); |
669 | 665 |
670 EXPECT_TRUE(stream1.stop_called()); | 666 EXPECT_TRUE(stream1.stop_called()); |
671 EXPECT_TRUE(stream1.start_called()); | 667 EXPECT_TRUE(stream1.start_called()); |
672 EXPECT_TRUE(stream2.stop_called()); | 668 EXPECT_TRUE(stream2.stop_called()); |
673 EXPECT_TRUE(stream2.start_called()); | 669 EXPECT_TRUE(stream2.start_called()); |
674 } | 670 } |
675 | 671 |
676 } // namespace media | 672 } // namespace media |
OLD | NEW |