OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "content/public/common/content_switches.h" | 6 #include "content/public/common/content_switches.h" |
7 #include "content/renderer/media/mock_media_constraint_factory.h" | 7 #include "content/renderer/media/mock_media_constraint_factory.h" |
8 #include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h" | 8 #include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h" |
9 #include "content/renderer/media/webrtc_local_audio_track.h" | 9 #include "content/renderer/media/webrtc_local_audio_track.h" |
10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 media::CHANNEL_LAYOUT_STEREO, 48000, 16, 480), | 38 media::CHANNEL_LAYOUT_STEREO, 48000, 16, 480), |
39 adapter_(WebRtcLocalAudioTrackAdapter::Create(std::string(), NULL)) { | 39 adapter_(WebRtcLocalAudioTrackAdapter::Create(std::string(), NULL)) { |
40 MockMediaConstraintFactory constraint_factory; | 40 MockMediaConstraintFactory constraint_factory; |
41 capturer_ = WebRtcAudioCapturer::CreateCapturer( | 41 capturer_ = WebRtcAudioCapturer::CreateCapturer( |
42 -1, StreamDeviceInfo(MEDIA_DEVICE_AUDIO_CAPTURE, "", ""), | 42 -1, StreamDeviceInfo(MEDIA_DEVICE_AUDIO_CAPTURE, "", ""), |
43 constraint_factory.CreateWebMediaConstraints(), NULL, NULL); | 43 constraint_factory.CreateWebMediaConstraints(), NULL, NULL); |
44 track_.reset(new WebRtcLocalAudioTrack(adapter_.get(), capturer_, NULL)); | 44 track_.reset(new WebRtcLocalAudioTrack(adapter_.get(), capturer_, NULL)); |
45 } | 45 } |
46 | 46 |
47 protected: | 47 protected: |
48 virtual void SetUp() OVERRIDE { | 48 virtual void SetUp() override { |
49 track_->OnSetFormat(params_); | 49 track_->OnSetFormat(params_); |
50 EXPECT_TRUE(track_->GetAudioAdapter()->enabled()); | 50 EXPECT_TRUE(track_->GetAudioAdapter()->enabled()); |
51 } | 51 } |
52 | 52 |
53 media::AudioParameters params_; | 53 media::AudioParameters params_; |
54 scoped_refptr<WebRtcLocalAudioTrackAdapter> adapter_; | 54 scoped_refptr<WebRtcLocalAudioTrackAdapter> adapter_; |
55 scoped_refptr<WebRtcAudioCapturer> capturer_; | 55 scoped_refptr<WebRtcAudioCapturer> capturer_; |
56 scoped_ptr<WebRtcLocalAudioTrack> track_; | 56 scoped_ptr<WebRtcLocalAudioTrack> track_; |
57 }; | 57 }; |
58 | 58 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 int signal_level = 0; | 90 int signal_level = 0; |
91 EXPECT_TRUE(webrtc_track->GetSignalLevel(&signal_level)); | 91 EXPECT_TRUE(webrtc_track->GetSignalLevel(&signal_level)); |
92 | 92 |
93 // Disable the audio processing in the audio track. | 93 // Disable the audio processing in the audio track. |
94 CommandLine::ForCurrentProcess()->AppendSwitch( | 94 CommandLine::ForCurrentProcess()->AppendSwitch( |
95 switches::kDisableAudioTrackProcessing); | 95 switches::kDisableAudioTrackProcessing); |
96 EXPECT_FALSE(webrtc_track->GetSignalLevel(&signal_level)); | 96 EXPECT_FALSE(webrtc_track->GetSignalLevel(&signal_level)); |
97 } | 97 } |
98 | 98 |
99 } // namespace content | 99 } // namespace content |
OLD | NEW |