OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/synchronization/waitable_event.h" | 8 #include "base/synchronization/waitable_event.h" |
9 #include "base/test/test_timeouts.h" | 9 #include "base/test/test_timeouts.h" |
10 #include "media/audio/audio_input_controller.h" | 10 #include "media/audio/audio_input_controller.h" |
11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 using ::testing::_; | 14 using ::testing::_; |
15 using ::testing::AtLeast; | 15 using ::testing::AtLeast; |
16 using ::testing::Exactly; | 16 using ::testing::Exactly; |
17 using ::testing::InvokeWithoutArgs; | 17 using ::testing::InvokeWithoutArgs; |
18 using ::testing::NotNull; | 18 using ::testing::NotNull; |
19 | 19 |
20 namespace media { | 20 namespace media { |
21 | 21 |
22 static const int kSampleRate = AudioParameters::kAudioCDSampleRate; | 22 static const int kSampleRate = AudioParameters::kAudioCDSampleRate; |
23 static const int kBitsPerSample = 16; | 23 static const int kBitsPerSample = 16; |
24 static const int kChannels = 2; | |
25 static const ChannelLayout kChannelLayout = CHANNEL_LAYOUT_STEREO; | 24 static const ChannelLayout kChannelLayout = CHANNEL_LAYOUT_STEREO; |
26 static const int kSamplesPerPacket = kSampleRate / 10; | 25 static const int kSamplesPerPacket = kSampleRate / 10; |
27 | 26 |
28 // Posts MessageLoop::QuitClosure() on specified message loop. | 27 // Posts MessageLoop::QuitClosure() on specified message loop. |
29 ACTION_P(QuitMessageLoop, loop_or_proxy) { | 28 ACTION_P(QuitMessageLoop, loop_or_proxy) { |
30 loop_or_proxy->PostTask(FROM_HERE, MessageLoop::QuitClosure()); | 29 loop_or_proxy->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
31 } | 30 } |
32 | 31 |
33 // Posts MessageLoop::QuitClosure() on specified message loop after a certain | 32 // Posts MessageLoop::QuitClosure() on specified message loop after a certain |
34 // number of calls given by |limit|. | 33 // number of calls given by |limit|. |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 controller->Record(); | 220 controller->Record(); |
222 | 221 |
223 controller->Close(MessageLoop::QuitClosure()); | 222 controller->Close(MessageLoop::QuitClosure()); |
224 MessageLoop::current()->Run(); | 223 MessageLoop::current()->Run(); |
225 | 224 |
226 controller->Close(MessageLoop::QuitClosure()); | 225 controller->Close(MessageLoop::QuitClosure()); |
227 MessageLoop::current()->Run(); | 226 MessageLoop::current()->Run(); |
228 } | 227 } |
229 | 228 |
230 } // namespace media | 229 } // namespace media |
OLD | NEW |