Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(508)

Side by Side Diff: webrtc/call/call_unittest.cc

Issue 1403363003: Move VoiceEngineObserver into AudioSendStream so that we detect typing noises and return properly i… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: better comments Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <list> 11 #include <list>
12 12
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 14
15 #include "webrtc/audio_state.h"
15 #include "webrtc/call.h" 16 #include "webrtc/call.h"
16 #include "webrtc/test/fake_voice_engine.h" 17 #include "webrtc/test/fake_voice_engine.h"
17 18
18 namespace { 19 namespace {
19 20
20 struct CallHelper { 21 struct CallHelper {
21 CallHelper() : voice_engine_(new webrtc::test::FakeVoiceEngine()) { 22 CallHelper() : voice_engine_(new webrtc::test::FakeVoiceEngine()) {
23 webrtc::AudioState::Config audio_state_config;
24 audio_state_config.voice_engine = voice_engine_.get();
25 audio_state_.reset(webrtc::AudioState::Create(audio_state_config));
22 webrtc::Call::Config config; 26 webrtc::Call::Config config;
23 config.voice_engine = voice_engine_.get(); 27 config.audio_state = audio_state_.get();
24 call_.reset(webrtc::Call::Create(config)); 28 call_.reset(webrtc::Call::Create(config));
25 } 29 }
26 30
27 webrtc::Call* operator->() { return call_.get(); } 31 webrtc::Call* operator->() { return call_.get(); }
28 32
29 private: 33 private:
30 rtc::scoped_ptr<webrtc::test::FakeVoiceEngine> voice_engine_; 34 rtc::scoped_ptr<webrtc::test::FakeVoiceEngine> voice_engine_;
35 rtc::scoped_ptr<webrtc::AudioState> audio_state_;
31 rtc::scoped_ptr<webrtc::Call> call_; 36 rtc::scoped_ptr<webrtc::Call> call_;
32 }; 37 };
33 } // namespace 38 } // namespace
34 39
35 namespace webrtc { 40 namespace webrtc {
36 41
37 TEST(CallTest, ConstructDestruct) { 42 TEST(CallTest, ConstructDestruct) {
38 CallHelper call; 43 CallHelper call;
39 } 44 }
40 45
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 streams.push_front(stream); 102 streams.push_front(stream);
98 } 103 }
99 } 104 }
100 for (auto s : streams) { 105 for (auto s : streams) {
101 call->DestroyAudioReceiveStream(s); 106 call->DestroyAudioReceiveStream(s);
102 } 107 }
103 streams.clear(); 108 streams.clear();
104 } 109 }
105 } 110 }
106 } // namespace webrtc 111 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698