blob: 5b85c3e2e89ce7a2b46f8283207b4c244cca695f [file] [log] [blame]
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +00001/*
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.org0de00492013-09-30 08:43:50 +000016#include "webrtc/common.h"
pbos@webrtc.org471ae722013-05-21 13:52:32 +000017#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.org85107502013-05-21 11:25:12 +000035#include "webrtc/voice_engine/test/auto_test/voe_test_common.h"
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000036
pbos@webrtc.org85107502013-05-21 11:25:12 +000037#include "testing/gmock/include/gmock/gmock.h"
38#include "testing/gtest/include/gtest/gtest.h"
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000039
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000040// 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.
51class BeforeInitializationFixture : public testing::Test {
52 public:
53 BeforeInitializationFixture();
54 virtual ~BeforeInitializationFixture();
55
56 protected:
andrew@webrtc.orgfbb6e452013-01-05 03:30:11 +000057 // Use this sleep function to sleep in tests.
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000058 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.org0de00492013-09-30 08:43:50 +000075 webrtc::Config config_;
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000076};
77
78#endif // SRC_VOICE_ENGINE_MAIN_TEST_AUTO_TEST_STANDARD_TEST_BASE_H_