phoglund@webrtc.org | 667eca6 | 2011-12-14 13:55:34 +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 | |
Mirko Bonadei | 7120742 | 2017-09-15 13:58:09 +0200 | [diff] [blame^] | 14 | #include "common_types.h" // NOLINT(build/include) |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 15 | #include "test/gmock.h" |
| 16 | #include "test/gtest.h" |
Mirko Bonadei | 7120742 | 2017-09-15 13:58:09 +0200 | [diff] [blame^] | 17 | #include "typedefs.h" // NOLINT(build/include) |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 18 | #include "voice_engine/include/voe_base.h" |
| 19 | #include "voice_engine/include/voe_codec.h" |
| 20 | #include "voice_engine/include/voe_errors.h" |
| 21 | #include "voice_engine/include/voe_file.h" |
| 22 | #include "voice_engine/include/voe_network.h" |
| 23 | #include "voice_engine/include/voe_rtp_rtcp.h" |
| 24 | #include "voice_engine/test/auto_test/voe_test_common.h" |
phoglund@webrtc.org | 667eca6 | 2011-12-14 13:55:34 +0000 | [diff] [blame] | 25 | |
phoglund@webrtc.org | 667eca6 | 2011-12-14 13:55:34 +0000 | [diff] [blame] | 26 | // This convenient fixture sets up all voice engine interfaces automatically for |
| 27 | // use by testing subclasses. It allocates each interface and releases it once |
| 28 | // which means that if a tests allocates additional interfaces from the voice |
| 29 | // engine and forgets to release it, this test will fail in the destructor. |
| 30 | // It will not call any init methods. |
| 31 | // |
| 32 | // Implementation note: |
| 33 | // The interface fetching is done in the constructor and not SetUp() since |
| 34 | // this relieves our subclasses from calling SetUp in the superclass if they |
| 35 | // choose to override SetUp() themselves. This is fine as googletest will |
| 36 | // construct new test objects for each method. |
| 37 | class BeforeInitializationFixture : public testing::Test { |
| 38 | public: |
| 39 | BeforeInitializationFixture(); |
| 40 | virtual ~BeforeInitializationFixture(); |
| 41 | |
| 42 | protected: |
andrew@webrtc.org | 1926d33 | 2013-01-05 03:30:11 +0000 | [diff] [blame] | 43 | // Use this sleep function to sleep in tests. |
phoglund@webrtc.org | c12f815 | 2012-01-16 12:40:18 +0000 | [diff] [blame] | 44 | void Sleep(long milliseconds); |
| 45 | |
phoglund@webrtc.org | 667eca6 | 2011-12-14 13:55:34 +0000 | [diff] [blame] | 46 | webrtc::VoiceEngine* voice_engine_; |
| 47 | webrtc::VoEBase* voe_base_; |
| 48 | webrtc::VoECodec* voe_codec_; |
phoglund@webrtc.org | 667eca6 | 2011-12-14 13:55:34 +0000 | [diff] [blame] | 49 | webrtc::VoERTP_RTCP* voe_rtp_rtcp_; |
phoglund@webrtc.org | 667eca6 | 2011-12-14 13:55:34 +0000 | [diff] [blame] | 50 | webrtc::VoENetwork* voe_network_; |
| 51 | webrtc::VoEFile* voe_file_; |
phoglund@webrtc.org | 667eca6 | 2011-12-14 13:55:34 +0000 | [diff] [blame] | 52 | }; |
| 53 | |
| 54 | #endif // SRC_VOICE_ENGINE_MAIN_TEST_AUTO_TEST_STANDARD_TEST_BASE_H_ |