| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #include <memory> | 11 #include <memory> |
| 12 | 12 |
| 13 #include "webrtc/test/gtest.h" | 13 #include "webrtc/test/gtest.h" |
| 14 | 14 |
| 15 #include "webrtc/audio/audio_state.h" | 15 #include "webrtc/audio/audio_state.h" |
| 16 #include "webrtc/test/mock_voice_engine.h" | 16 #include "webrtc/test/mock_voice_engine.h" |
| 17 | 17 |
| 18 namespace webrtc { | 18 namespace webrtc { |
| 19 namespace test { | 19 namespace test { |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 struct ConfigHelper { | 22 struct ConfigHelper { |
| 23 ConfigHelper() { | 23 ConfigHelper() { |
| 24 EXPECT_CALL(voice_engine_, | 24 EXPECT_CALL(voice_engine_, |
| 25 RegisterVoiceEngineObserver(testing::_)).WillOnce(testing::Return(0)); | 25 RegisterVoiceEngineObserver(testing::_)).WillOnce(testing::Return(0)); |
| 26 EXPECT_CALL(voice_engine_, | 26 EXPECT_CALL(voice_engine_, |
| 27 DeRegisterVoiceEngineObserver()).WillOnce(testing::Return(0)); | 27 DeRegisterVoiceEngineObserver()).WillOnce(testing::Return(0)); |
| 28 EXPECT_CALL(voice_engine_, audio_transport()) |
| 29 .WillOnce(testing::Return(nullptr)); |
| 28 config_.voice_engine = &voice_engine_; | 30 config_.voice_engine = &voice_engine_; |
| 29 } | 31 } |
| 30 AudioState::Config& config() { return config_; } | 32 AudioState::Config& config() { return config_; } |
| 31 MockVoiceEngine& voice_engine() { return voice_engine_; } | 33 MockVoiceEngine& voice_engine() { return voice_engine_; } |
| 32 | 34 |
| 33 private: | 35 private: |
| 34 testing::StrictMock<MockVoiceEngine> voice_engine_; | 36 testing::StrictMock<MockVoiceEngine> voice_engine_; |
| 35 AudioState::Config config_; | 37 AudioState::Config config_; |
| 36 }; | 38 }; |
| 37 } // namespace | 39 } // namespace |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 voe_observer->CallbackOnError(-1, VE_NOT_INITED); | 74 voe_observer->CallbackOnError(-1, VE_NOT_INITED); |
| 73 EXPECT_TRUE(audio_state->typing_noise_detected()); | 75 EXPECT_TRUE(audio_state->typing_noise_detected()); |
| 74 | 76 |
| 75 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_OFF_WARNING); | 77 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_OFF_WARNING); |
| 76 EXPECT_FALSE(audio_state->typing_noise_detected()); | 78 EXPECT_FALSE(audio_state->typing_noise_detected()); |
| 77 voe_observer->CallbackOnError(-1, VE_NOT_INITED); | 79 voe_observer->CallbackOnError(-1, VE_NOT_INITED); |
| 78 EXPECT_FALSE(audio_state->typing_noise_detected()); | 80 EXPECT_FALSE(audio_state->typing_noise_detected()); |
| 79 } | 81 } |
| 80 } // namespace test | 82 } // namespace test |
| 81 } // namespace webrtc | 83 } // namespace webrtc |
| OLD | NEW |