andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 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_ |
| 13 | |
| 14 | #include <assert.h> |
| 15 | |
minyue@webrtc.org | 0de0049 | 2013-09-30 08:43:50 +0000 | [diff] [blame^] | 16 | #include "webrtc/common.h" |
pbos@webrtc.org | 471ae72 | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 17 | #include "webrtc/common_types.h" |
| 18 | #include "webrtc/engine_configurations.h" |
| 19 | #include "webrtc/test/testsupport/gtest_disable.h" |
| 20 | #include "webrtc/voice_engine/include/voe_audio_processing.h" |
| 21 | #include "webrtc/voice_engine/include/voe_base.h" |
| 22 | #include "webrtc/voice_engine/include/voe_call_report.h" |
| 23 | #include "webrtc/voice_engine/include/voe_codec.h" |
| 24 | #include "webrtc/voice_engine/include/voe_dtmf.h" |
| 25 | #include "webrtc/voice_engine/include/voe_encryption.h" |
| 26 | #include "webrtc/voice_engine/include/voe_errors.h" |
| 27 | #include "webrtc/voice_engine/include/voe_external_media.h" |
| 28 | #include "webrtc/voice_engine/include/voe_file.h" |
| 29 | #include "webrtc/voice_engine/include/voe_hardware.h" |
| 30 | #include "webrtc/voice_engine/include/voe_neteq_stats.h" |
| 31 | #include "webrtc/voice_engine/include/voe_network.h" |
| 32 | #include "webrtc/voice_engine/include/voe_rtp_rtcp.h" |
| 33 | #include "webrtc/voice_engine/include/voe_video_sync.h" |
| 34 | #include "webrtc/voice_engine/include/voe_volume_control.h" |
pbos@webrtc.org | 8510750 | 2013-05-21 11:25:12 +0000 | [diff] [blame] | 35 | #include "webrtc/voice_engine/test/auto_test/voe_test_common.h" |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 36 | |
pbos@webrtc.org | 8510750 | 2013-05-21 11:25:12 +0000 | [diff] [blame] | 37 | #include "testing/gmock/include/gmock/gmock.h" |
| 38 | #include "testing/gtest/include/gtest/gtest.h" |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 39 | |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 40 | // This convenient fixture sets up all voice engine interfaces automatically for |
| 41 | // use by testing subclasses. It allocates each interface and releases it once |
| 42 | // which means that if a tests allocates additional interfaces from the voice |
| 43 | // engine and forgets to release it, this test will fail in the destructor. |
| 44 | // It will not call any init methods. |
| 45 | // |
| 46 | // Implementation note: |
| 47 | // The interface fetching is done in the constructor and not SetUp() since |
| 48 | // this relieves our subclasses from calling SetUp in the superclass if they |
| 49 | // choose to override SetUp() themselves. This is fine as googletest will |
| 50 | // construct new test objects for each method. |
| 51 | class BeforeInitializationFixture : public testing::Test { |
| 52 | public: |
| 53 | BeforeInitializationFixture(); |
| 54 | virtual ~BeforeInitializationFixture(); |
| 55 | |
| 56 | protected: |
andrew@webrtc.org | fbb6e45 | 2013-01-05 03:30:11 +0000 | [diff] [blame] | 57 | // Use this sleep function to sleep in tests. |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 58 | void Sleep(long milliseconds); |
| 59 | |
| 60 | webrtc::VoiceEngine* voice_engine_; |
| 61 | webrtc::VoEBase* voe_base_; |
| 62 | webrtc::VoECodec* voe_codec_; |
| 63 | webrtc::VoEVolumeControl* voe_volume_control_; |
| 64 | webrtc::VoEDtmf* voe_dtmf_; |
| 65 | webrtc::VoERTP_RTCP* voe_rtp_rtcp_; |
| 66 | webrtc::VoEAudioProcessing* voe_apm_; |
| 67 | webrtc::VoENetwork* voe_network_; |
| 68 | webrtc::VoEFile* voe_file_; |
| 69 | webrtc::VoEVideoSync* voe_vsync_; |
| 70 | webrtc::VoEEncryption* voe_encrypt_; |
| 71 | webrtc::VoEHardware* voe_hardware_; |
| 72 | webrtc::VoEExternalMedia* voe_xmedia_; |
| 73 | webrtc::VoECallReport* voe_call_report_; |
| 74 | webrtc::VoENetEqStats* voe_neteq_stats_; |
minyue@webrtc.org | 0de0049 | 2013-09-30 08:43:50 +0000 | [diff] [blame^] | 75 | webrtc::Config config_; |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 76 | }; |
| 77 | |
| 78 | #endif // SRC_VOICE_ENGINE_MAIN_TEST_AUTO_TEST_STANDARD_TEST_BASE_H_ |