Index: webrtc/modules/audio_coding/codecs/mock_audio_decoder_factory.h |
diff --git a/webrtc/modules/audio_coding/codecs/mock_audio_decoder_factory.h b/webrtc/modules/audio_coding/codecs/mock_audio_decoder_factory.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2dc1c1b0ac8bb0938d71c989e6b8719a843ff70b |
--- /dev/null |
+++ b/webrtc/modules/audio_coding/codecs/mock_audio_decoder_factory.h |
@@ -0,0 +1,37 @@ |
+/* |
hlundin-webrtc
2016/04/29 11:52:56
We used to have the structure that the mock for pa
kwiberg-webrtc
2016/04/29 23:10:13
Laudable. Will change. But we have only one mock i
|
+ * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
+ * |
+ * Use of this source code is governed by a BSD-style license |
+ * that can be found in the LICENSE file in the root of the source |
+ * tree. An additional intellectual property rights grant can be found |
+ * in the file PATENTS. All contributing project authors may |
+ * be found in the AUTHORS file in the root of the source tree. |
+ */ |
+ |
+#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_MOCK_AUDIO_DECODER_FACTORY_H_ |
+#define WEBRTC_MODULES_AUDIO_CODING_CODECS_MOCK_AUDIO_DECODER_FACTORY_H_ |
+ |
+#include <vector> |
+ |
+#include "testing/gmock/include/gmock/gmock.h" |
+#include "webrtc/modules/audio_coding/codecs/audio_decoder_factory.h" |
+ |
+namespace webrtc { |
+ |
+class MockAudioDecoderFactory : public AudioDecoderFactory { |
+ public: |
+ MOCK_METHOD0(GetSupportedFormats, std::vector<SdpAudioFormat>()); |
+ std::unique_ptr<AudioDecoder> MakeAudioDecoder( |
ossu
2016/04/29 12:21:33
Why is this? Just to remove the std::unique_ptr<>
kwiberg-webrtc
2016/04/29 23:10:13
Yes. gmock is pre-C++11 and doesn't properly forwa
ossu
2016/05/02 10:59:40
Ah, I see.
|
+ const SdpAudioFormat& format) override { |
+ std::unique_ptr<AudioDecoder> return_value; |
+ MakeAudioDecoderMock(format, &return_value); |
+ return return_value; |
+ } |
+ MOCK_METHOD2(MakeAudioDecoderMock, |
+ void(const SdpAudioFormat& format, |
+ std::unique_ptr<AudioDecoder>* return_value)); |
+}; |
+ |
+} // namespace webrtc |
+ |
+#endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_MOCK_AUDIO_DECODER_FACTORY_H_ |