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 <windows.h> | 5 #include <windows.h> |
6 #include <mmsystem.h> | 6 #include <mmsystem.h> |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 using ::testing::_; | 25 using ::testing::_; |
26 using ::testing::AnyNumber; | 26 using ::testing::AnyNumber; |
27 using ::testing::AtLeast; | 27 using ::testing::AtLeast; |
28 using ::testing::Gt; | 28 using ::testing::Gt; |
29 using ::testing::NotNull; | 29 using ::testing::NotNull; |
30 | 30 |
31 namespace media { | 31 namespace media { |
32 | 32 |
33 ACTION_P3(CheckCountAndPostQuitTask, count, limit, loop) { | 33 ACTION_P3(CheckCountAndPostQuitTask, count, limit, loop) { |
34 if (++*count >= limit) { | 34 if (++*count >= limit) { |
35 loop->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); | 35 loop->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); |
36 } | 36 } |
37 } | 37 } |
38 | 38 |
39 class MockAudioInputCallback : public AudioInputStream::AudioInputCallback { | 39 class MockAudioInputCallback : public AudioInputStream::AudioInputCallback { |
40 public: | 40 public: |
41 MOCK_METHOD4(OnData, | 41 MOCK_METHOD4(OnData, |
42 void(AudioInputStream* stream, | 42 void(AudioInputStream* stream, |
43 const AudioBus* src, | 43 const AudioBus* src, |
44 uint32 hardware_delay_bytes, | 44 uint32 hardware_delay_bytes, |
45 double volume)); | 45 double volume)); |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 WriteToFileAudioSink file_sink(file_name, aisw.bits_per_sample()); | 463 WriteToFileAudioSink file_sink(file_name, aisw.bits_per_sample()); |
464 VLOG(0) << ">> Speak into the default microphone while recording."; | 464 VLOG(0) << ">> Speak into the default microphone while recording."; |
465 ais->Start(&file_sink); | 465 ais->Start(&file_sink); |
466 base::PlatformThread::Sleep(TestTimeouts::action_timeout()); | 466 base::PlatformThread::Sleep(TestTimeouts::action_timeout()); |
467 ais->Stop(); | 467 ais->Stop(); |
468 VLOG(0) << ">> Recording has stopped."; | 468 VLOG(0) << ">> Recording has stopped."; |
469 ais.Close(); | 469 ais.Close(); |
470 } | 470 } |
471 | 471 |
472 } // namespace media | 472 } // namespace media |
OLD | NEW |