Upstream version 7.35.144.0
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / voice_engine / test / auto_test / standard / manual_hold_test.cc
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 #include "webrtc/voice_engine/test/auto_test/fixtures/after_streaming_fixture.h"
12
13 // Note: This class includes sleeps and requires manual verification.
14 class ManualHoldTest : public AfterStreamingFixture {
15 };
16
17 TEST_F(ManualHoldTest, SetOnHoldStatusBlockAudio) {
18   TEST_LOG("Channel not on hold => should hear audio.\n");
19   Sleep(2000);
20   TEST_LOG("Put channel on hold => should *not* hear audio.\n");
21   EXPECT_EQ(0, voe_base_->SetOnHoldStatus(channel_, true));
22   Sleep(2000);
23   TEST_LOG("Remove on hold => should hear audio again.\n");
24   EXPECT_EQ(0, voe_base_->SetOnHoldStatus(channel_, false));
25   Sleep(2000);
26   TEST_LOG("Put sending on hold => should *not* hear audio.\n");
27   EXPECT_EQ(0, voe_base_->SetOnHoldStatus(channel_, true, webrtc::kHoldSendOnly));
28   Sleep(2000);
29 }
30
31 TEST_F(ManualHoldTest, SetOnHoldStatusBlocksLocalFileAudio) {
32   TEST_LOG("Start playing a file locally => "
33       "you should now hear this file being played out.\n");
34   voe_file_->StopPlayingFileAsMicrophone(channel_);
35   EXPECT_EQ(0, voe_file_->StartPlayingFileLocally(
36       channel_, resource_manager_.long_audio_file_path().c_str(), true));
37   Sleep(2000);
38
39   TEST_LOG("Put playing on hold => should *not* hear audio.\n");
40   EXPECT_EQ(0, voe_base_->SetOnHoldStatus(
41       channel_, true, webrtc::kHoldPlayOnly));
42   Sleep(2000);
43 }