OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/logging.h" | 6 #include "base/logging.h" |
7 #include "content/public/common/content_switches.h" | 7 #include "content/public/common/content_switches.h" |
8 #include "content/renderer/media/mock_media_constraint_factory.h" | 8 #include "content/renderer/media/mock_media_constraint_factory.h" |
9 #include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h" | 9 #include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h" |
10 #include "content/renderer/media/webrtc_audio_capturer.h" | 10 #include "content/renderer/media/webrtc_audio_capturer.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 }; | 38 }; |
39 | 39 |
40 class MockPeerConnectionAudioSink : public PeerConnectionAudioSink { | 40 class MockPeerConnectionAudioSink : public PeerConnectionAudioSink { |
41 public: | 41 public: |
42 MockPeerConnectionAudioSink() {} | 42 MockPeerConnectionAudioSink() {} |
43 ~MockPeerConnectionAudioSink() {} | 43 ~MockPeerConnectionAudioSink() {} |
44 virtual int OnData(const int16* audio_data, int sample_rate, | 44 virtual int OnData(const int16* audio_data, int sample_rate, |
45 int number_of_channels, int number_of_frames, | 45 int number_of_channels, int number_of_frames, |
46 const std::vector<int>& channels, | 46 const std::vector<int>& channels, |
47 int audio_delay_milliseconds, int current_volume, | 47 int audio_delay_milliseconds, int current_volume, |
48 bool need_audio_processing, bool key_pressed) OVERRIDE { | 48 bool need_audio_processing, bool key_pressed) override { |
49 EXPECT_EQ(sample_rate, params_.sample_rate()); | 49 EXPECT_EQ(sample_rate, params_.sample_rate()); |
50 EXPECT_EQ(number_of_channels, params_.channels()); | 50 EXPECT_EQ(number_of_channels, params_.channels()); |
51 EXPECT_EQ(number_of_frames, params_.frames_per_buffer()); | 51 EXPECT_EQ(number_of_frames, params_.frames_per_buffer()); |
52 OnDataCallback(audio_data, channels, audio_delay_milliseconds, | 52 OnDataCallback(audio_data, channels, audio_delay_milliseconds, |
53 current_volume, need_audio_processing, key_pressed); | 53 current_volume, need_audio_processing, key_pressed); |
54 return 0; | 54 return 0; |
55 } | 55 } |
56 MOCK_METHOD6(OnDataCallback, void(const int16* audio_data, | 56 MOCK_METHOD6(OnDataCallback, void(const int16* audio_data, |
57 const std::vector<int>& channels, | 57 const std::vector<int>& channels, |
58 int audio_delay_milliseconds, | 58 int audio_delay_milliseconds, |
59 int current_volume, | 59 int current_volume, |
60 bool need_audio_processing, | 60 bool need_audio_processing, |
61 bool key_pressed)); | 61 bool key_pressed)); |
62 virtual void OnSetFormat(const media::AudioParameters& params) OVERRIDE { | 62 virtual void OnSetFormat(const media::AudioParameters& params) override { |
63 params_ = params; | 63 params_ = params; |
64 FormatIsSet(); | 64 FormatIsSet(); |
65 } | 65 } |
66 MOCK_METHOD0(FormatIsSet, void()); | 66 MOCK_METHOD0(FormatIsSet, void()); |
67 | 67 |
68 private: | 68 private: |
69 media::AudioParameters params_; | 69 media::AudioParameters params_; |
70 }; | 70 }; |
71 | 71 |
72 } // namespace | 72 } // namespace |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 "", "", params_.sample_rate(), | 184 "", "", params_.sample_rate(), |
185 params_.channel_layout(), | 185 params_.channel_layout(), |
186 params_.frames_per_buffer()), | 186 params_.frames_per_buffer()), |
187 constraint_factory.CreateWebMediaConstraints(), NULL, NULL) | 187 constraint_factory.CreateWebMediaConstraints(), NULL, NULL) |
188 ); | 188 ); |
189 EXPECT_TRUE(capturer.get() == NULL); | 189 EXPECT_TRUE(capturer.get() == NULL); |
190 } | 190 } |
191 | 191 |
192 | 192 |
193 } // namespace content | 193 } // namespace content |
OLD | NEW |