| 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 "media/audio/linux/audio_manager_linux.h" | 7 #include "media/audio/linux/audio_manager_linux.h" |
| 8 #include "media/audio/linux/cras_output.h" | 8 #include "media/audio/linux/cras_output.h" |
| 9 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 11 |
| 12 using testing::_; | 12 using testing::_; |
| 13 using testing::DoAll; | 13 using testing::DoAll; |
| 14 using testing::Return; | 14 using testing::Return; |
| 15 using testing::SetArgumentPointee; | 15 using testing::SetArgumentPointee; |
| 16 using testing::StrictMock; | 16 using testing::StrictMock; |
| 17 | 17 |
| 18 namespace media { | 18 namespace media { |
| 19 | 19 |
| 20 class MockAudioSourceCallback : public AudioOutputStream::AudioSourceCallback { | 20 class MockAudioSourceCallback : public AudioOutputStream::AudioSourceCallback { |
| 21 public: | 21 public: |
| 22 MOCK_METHOD2(OnMoreData, int(AudioBus* audio_bus, | 22 MOCK_METHOD2(OnMoreData, int(AudioBus* audio_bus, |
| 23 AudioBuffersState buffers_state)); | 23 AudioBuffersState buffers_state)); |
| 24 MOCK_METHOD3(OnMoreIOData, int(AudioBus* source, |
| 25 AudioBus* dest, |
| 26 AudioBuffersState buffers_state)); |
| 24 MOCK_METHOD2(OnError, void(AudioOutputStream* stream, int code)); | 27 MOCK_METHOD2(OnError, void(AudioOutputStream* stream, int code)); |
| 25 }; | 28 }; |
| 26 | 29 |
| 27 class MockAudioManagerLinux : public AudioManagerLinux { | 30 class MockAudioManagerLinux : public AudioManagerLinux { |
| 28 public: | 31 public: |
| 29 MOCK_METHOD0(Init, void()); | 32 MOCK_METHOD0(Init, void()); |
| 30 MOCK_METHOD0(HasAudioOutputDevices, bool()); | 33 MOCK_METHOD0(HasAudioOutputDevices, bool()); |
| 31 MOCK_METHOD0(HasAudioInputDevices, bool()); | 34 MOCK_METHOD0(HasAudioInputDevices, bool()); |
| 32 MOCK_METHOD1(MakeLinearOutputStream, AudioOutputStream*( | 35 MOCK_METHOD1(MakeLinearOutputStream, AudioOutputStream*( |
| 33 const AudioParameters& params)); | 36 const AudioParameters& params)); |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 | 211 |
| 209 // Stop. | 212 // Stop. |
| 210 test_stream->Stop(); | 213 test_stream->Stop(); |
| 211 EXPECT_EQ(CrasOutputStream::kIsStopped, test_stream->state()); | 214 EXPECT_EQ(CrasOutputStream::kIsStopped, test_stream->state()); |
| 212 | 215 |
| 213 // Close the stream. | 216 // Close the stream. |
| 214 test_stream->Close(); | 217 test_stream->Close(); |
| 215 } | 218 } |
| 216 | 219 |
| 217 } // namespace media | 220 } // namespace media |
| OLD | NEW |