| 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 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 EXPECT_CALL(voice_engine_, | 23 EXPECT_CALL(voice_engine_, |
| 24 RegisterVoiceEngineObserver(testing::_)).WillOnce(testing::Return(0)); | 24 RegisterVoiceEngineObserver(testing::_)).WillOnce(testing::Return(0)); |
| 25 EXPECT_CALL(voice_engine_, | 25 EXPECT_CALL(voice_engine_, |
| 26 DeRegisterVoiceEngineObserver()).WillOnce(testing::Return(0)); | 26 DeRegisterVoiceEngineObserver()).WillOnce(testing::Return(0)); |
| 27 config_.voice_engine = &voice_engine_; | 27 config_.voice_engine = &voice_engine_; |
| 28 } | 28 } |
| 29 AudioState::Config& config() { return config_; } | 29 AudioState::Config& config() { return config_; } |
| 30 MockVoiceEngine& voice_engine() { return voice_engine_; } | 30 MockVoiceEngine& voice_engine() { return voice_engine_; } |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 MockVoiceEngine voice_engine_; | 33 testing::StrictMock<MockVoiceEngine> voice_engine_; |
| 34 AudioState::Config config_; | 34 AudioState::Config config_; |
| 35 }; | 35 }; |
| 36 } // namespace | 36 } // namespace |
| 37 | 37 |
| 38 TEST(AudioStateTest, Create) { | 38 TEST(AudioStateTest, Create) { |
| 39 ConfigHelper helper; | 39 ConfigHelper helper; |
| 40 rtc::scoped_refptr<AudioState> audio_state = | 40 rtc::scoped_refptr<AudioState> audio_state = |
| 41 AudioState::Create(helper.config()); | 41 AudioState::Create(helper.config()); |
| 42 EXPECT_TRUE(audio_state.get()); | 42 EXPECT_TRUE(audio_state.get()); |
| 43 } | 43 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 71 voe_observer->CallbackOnError(-1, VE_NOT_INITED); | 71 voe_observer->CallbackOnError(-1, VE_NOT_INITED); |
| 72 EXPECT_TRUE(audio_state->typing_noise_detected()); | 72 EXPECT_TRUE(audio_state->typing_noise_detected()); |
| 73 | 73 |
| 74 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_OFF_WARNING); | 74 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_OFF_WARNING); |
| 75 EXPECT_FALSE(audio_state->typing_noise_detected()); | 75 EXPECT_FALSE(audio_state->typing_noise_detected()); |
| 76 voe_observer->CallbackOnError(-1, VE_NOT_INITED); | 76 voe_observer->CallbackOnError(-1, VE_NOT_INITED); |
| 77 EXPECT_FALSE(audio_state->typing_noise_detected()); | 77 EXPECT_FALSE(audio_state->typing_noise_detected()); |
| 78 } | 78 } |
| 79 } // namespace test | 79 } // namespace test |
| 80 } // namespace webrtc | 80 } // namespace webrtc |
| OLD | NEW |