OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef CHROMECAST_MEDIA_CMA_BACKEND_ALSA_MOCK_ALSA_WRAPPER_H_ | 5 #ifndef CHROMECAST_MEDIA_CMA_BACKEND_ALSA_MOCK_ALSA_WRAPPER_H_ |
6 #define CHROMECAST_MEDIA_CMA_BACKEND_ALSA_MOCK_ALSA_WRAPPER_H_ | 6 #define CHROMECAST_MEDIA_CMA_BACKEND_ALSA_MOCK_ALSA_WRAPPER_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <vector> | 9 #include <vector> |
9 | 10 |
10 #include "base/macros.h" | 11 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "chromecast/media/cma/backend/alsa/alsa_wrapper.h" | 12 #include "chromecast/media/cma/backend/alsa/alsa_wrapper.h" |
13 #include "media/audio/alsa/alsa_wrapper.h" | 13 #include "media/audio/alsa/alsa_wrapper.h" |
14 #include "testing/gmock/include/gmock/gmock.h" | 14 #include "testing/gmock/include/gmock/gmock.h" |
15 | 15 |
16 namespace chromecast { | 16 namespace chromecast { |
17 namespace media { | 17 namespace media { |
18 | 18 |
19 class MockAlsaWrapper : public AlsaWrapper { | 19 class MockAlsaWrapper : public AlsaWrapper { |
20 public: | 20 public: |
21 MockAlsaWrapper(); | 21 MockAlsaWrapper(); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 MOCK_METHOD2(PcmSwParams, int(snd_pcm_t* handle, snd_pcm_sw_params_t* obj)); | 141 MOCK_METHOD2(PcmSwParams, int(snd_pcm_t* handle, snd_pcm_sw_params_t* obj)); |
142 | 142 |
143 // Getters for test control. | 143 // Getters for test control. |
144 snd_pcm_state_t state(); | 144 snd_pcm_state_t state(); |
145 const std::vector<uint8_t>& data(); | 145 const std::vector<uint8_t>& data(); |
146 | 146 |
147 private: | 147 private: |
148 class FakeAlsaWrapper; | 148 class FakeAlsaWrapper; |
149 | 149 |
150 // Certain calls will be delegated to this class. | 150 // Certain calls will be delegated to this class. |
151 scoped_ptr<FakeAlsaWrapper> fake_; | 151 std::unique_ptr<FakeAlsaWrapper> fake_; |
152 | 152 |
153 DISALLOW_COPY_AND_ASSIGN(MockAlsaWrapper); | 153 DISALLOW_COPY_AND_ASSIGN(MockAlsaWrapper); |
154 }; | 154 }; |
155 | 155 |
156 } // namespace media | 156 } // namespace media |
157 } // namespace chromecast | 157 } // namespace chromecast |
158 | 158 |
159 #endif // CHROMECAST_MEDIA_CMA_BACKEND_ALSA_MOCK_ALSA_WRAPPER_H_ | 159 #endif // CHROMECAST_MEDIA_CMA_BACKEND_ALSA_MOCK_ALSA_WRAPPER_H_ |
OLD | NEW |