| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #ifndef SRC_VOICE_ENGINE_MAIN_TEST_AUTO_TEST_STANDARD_TEST_BASE_H_ | 11 #ifndef SRC_VOICE_ENGINE_MAIN_TEST_AUTO_TEST_STANDARD_TEST_BASE_H_ |
| 12 #define SRC_VOICE_ENGINE_MAIN_TEST_AUTO_TEST_STANDARD_TEST_BASE_H_ | 12 #define SRC_VOICE_ENGINE_MAIN_TEST_AUTO_TEST_STANDARD_TEST_BASE_H_ |
| 13 | 13 |
| 14 #include "webrtc/common_types.h" | 14 #include "webrtc/common_types.h" |
| 15 #include "webrtc/test/gmock.h" | 15 #include "webrtc/test/gmock.h" |
| 16 #include "webrtc/test/gtest.h" | 16 #include "webrtc/test/gtest.h" |
| 17 #include "webrtc/typedefs.h" | 17 #include "webrtc/typedefs.h" |
| 18 #include "webrtc/voice_engine/include/voe_audio_processing.h" | 18 #include "webrtc/voice_engine/include/voe_audio_processing.h" |
| 19 #include "webrtc/voice_engine/include/voe_base.h" | 19 #include "webrtc/voice_engine/include/voe_base.h" |
| 20 #include "webrtc/voice_engine/include/voe_codec.h" | 20 #include "webrtc/voice_engine/include/voe_codec.h" |
| 21 #include "webrtc/voice_engine/include/voe_errors.h" | 21 #include "webrtc/voice_engine/include/voe_errors.h" |
| 22 #include "webrtc/voice_engine/include/voe_file.h" | 22 #include "webrtc/voice_engine/include/voe_file.h" |
| 23 #include "webrtc/voice_engine/include/voe_hardware.h" | 23 #include "webrtc/voice_engine/include/voe_hardware.h" |
| 24 #include "webrtc/voice_engine/include/voe_neteq_stats.h" | 24 #include "webrtc/voice_engine/include/voe_neteq_stats.h" |
| 25 #include "webrtc/voice_engine/include/voe_network.h" | 25 #include "webrtc/voice_engine/include/voe_network.h" |
| 26 #include "webrtc/voice_engine/include/voe_rtp_rtcp.h" | 26 #include "webrtc/voice_engine/include/voe_rtp_rtcp.h" |
| 27 #include "webrtc/voice_engine/include/voe_volume_control.h" | |
| 28 #include "webrtc/voice_engine/test/auto_test/voe_test_common.h" | 27 #include "webrtc/voice_engine/test/auto_test/voe_test_common.h" |
| 29 | 28 |
| 30 // This convenient fixture sets up all voice engine interfaces automatically for | 29 // This convenient fixture sets up all voice engine interfaces automatically for |
| 31 // use by testing subclasses. It allocates each interface and releases it once | 30 // use by testing subclasses. It allocates each interface and releases it once |
| 32 // which means that if a tests allocates additional interfaces from the voice | 31 // which means that if a tests allocates additional interfaces from the voice |
| 33 // engine and forgets to release it, this test will fail in the destructor. | 32 // engine and forgets to release it, this test will fail in the destructor. |
| 34 // It will not call any init methods. | 33 // It will not call any init methods. |
| 35 // | 34 // |
| 36 // Implementation note: | 35 // Implementation note: |
| 37 // The interface fetching is done in the constructor and not SetUp() since | 36 // The interface fetching is done in the constructor and not SetUp() since |
| 38 // this relieves our subclasses from calling SetUp in the superclass if they | 37 // this relieves our subclasses from calling SetUp in the superclass if they |
| 39 // choose to override SetUp() themselves. This is fine as googletest will | 38 // choose to override SetUp() themselves. This is fine as googletest will |
| 40 // construct new test objects for each method. | 39 // construct new test objects for each method. |
| 41 class BeforeInitializationFixture : public testing::Test { | 40 class BeforeInitializationFixture : public testing::Test { |
| 42 public: | 41 public: |
| 43 BeforeInitializationFixture(); | 42 BeforeInitializationFixture(); |
| 44 virtual ~BeforeInitializationFixture(); | 43 virtual ~BeforeInitializationFixture(); |
| 45 | 44 |
| 46 protected: | 45 protected: |
| 47 // Use this sleep function to sleep in tests. | 46 // Use this sleep function to sleep in tests. |
| 48 void Sleep(long milliseconds); | 47 void Sleep(long milliseconds); |
| 49 | 48 |
| 50 webrtc::VoiceEngine* voice_engine_; | 49 webrtc::VoiceEngine* voice_engine_; |
| 51 webrtc::VoEBase* voe_base_; | 50 webrtc::VoEBase* voe_base_; |
| 52 webrtc::VoECodec* voe_codec_; | 51 webrtc::VoECodec* voe_codec_; |
| 53 webrtc::VoEVolumeControl* voe_volume_control_; | |
| 54 webrtc::VoERTP_RTCP* voe_rtp_rtcp_; | 52 webrtc::VoERTP_RTCP* voe_rtp_rtcp_; |
| 55 webrtc::VoEAudioProcessing* voe_apm_; | 53 webrtc::VoEAudioProcessing* voe_apm_; |
| 56 webrtc::VoENetwork* voe_network_; | 54 webrtc::VoENetwork* voe_network_; |
| 57 webrtc::VoEFile* voe_file_; | 55 webrtc::VoEFile* voe_file_; |
| 58 webrtc::VoEHardware* voe_hardware_; | 56 webrtc::VoEHardware* voe_hardware_; |
| 59 webrtc::VoENetEqStats* voe_neteq_stats_; | 57 webrtc::VoENetEqStats* voe_neteq_stats_; |
| 60 }; | 58 }; |
| 61 | 59 |
| 62 #endif // SRC_VOICE_ENGINE_MAIN_TEST_AUTO_TEST_STANDARD_TEST_BASE_H_ | 60 #endif // SRC_VOICE_ENGINE_MAIN_TEST_AUTO_TEST_STANDARD_TEST_BASE_H_ |
| OLD | NEW |