1/*
2 *  Copyright (c) 2014 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_BEFORE_STREAMING_H_
12#define SRC_VOICE_ENGINE_MAIN_TEST_AUTO_TEST_STANDARD_BEFORE_STREAMING_H_
13
14#include <string>
15#include "webrtc/voice_engine/test/auto_test/fixtures/after_initialization_fixture.h"
16#include "webrtc/voice_engine/test/auto_test/resource_manager.h"
17
18// This fixture will, in addition to the work done by its superclasses,
19// create a channel and prepare playing a file through the fake microphone
20// to simulate microphone input. The purpose is to make it convenient
21// to write tests that require microphone input.
22class BeforeStreamingFixture : public AfterInitializationFixture {
23 public:
24  BeforeStreamingFixture();
25  virtual ~BeforeStreamingFixture();
26
27 protected:
28  int             channel_;
29  ResourceManager resource_manager_;
30  std::string     fake_microphone_input_file_;
31
32  // Shuts off the fake microphone for this test.
33  void SwitchToManualMicrophone();
34
35  // Restarts the fake microphone if it's been shut off earlier.
36  void RestartFakeMicrophone();
37
38  // Stops all sending and playout.
39  void PausePlaying();
40
41  // Resumes all sending and playout.
42  void ResumePlaying();
43
44 private:
45  void SetUpLocalPlayback();
46
47  LoopBackTransport* transport_;
48};
49
50
51#endif  // SRC_VOICE_ENGINE_MAIN_TEST_AUTO_TEST_STANDARD_BEFORE_STREAMING_H_
52