| 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/android/build_info.h" | 5 #include "base/android/build_info.h" |
| 6 #include "base/basictypes.h" | 6 #include "base/basictypes.h" |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 using ::testing::DoAll; | 32 using ::testing::DoAll; |
| 33 using ::testing::Invoke; | 33 using ::testing::Invoke; |
| 34 using ::testing::NotNull; | 34 using ::testing::NotNull; |
| 35 using ::testing::Return; | 35 using ::testing::Return; |
| 36 | 36 |
| 37 namespace media { | 37 namespace media { |
| 38 namespace { | 38 namespace { |
| 39 | 39 |
| 40 ACTION_P3(CheckCountAndPostQuitTask, count, limit, loop) { | 40 ACTION_P3(CheckCountAndPostQuitTask, count, limit, loop) { |
| 41 if (++*count >= limit) { | 41 if (++*count >= limit) { |
| 42 loop->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); | 42 loop->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 | 45 |
| 46 const char kSpeechFile_16b_s_48k[] = "speech_16b_stereo_48kHz.raw"; | 46 const char kSpeechFile_16b_s_48k[] = "speech_16b_stereo_48kHz.raw"; |
| 47 const char kSpeechFile_16b_m_48k[] = "speech_16b_mono_48kHz.raw"; | 47 const char kSpeechFile_16b_m_48k[] = "speech_16b_mono_48kHz.raw"; |
| 48 const char kSpeechFile_16b_s_44k[] = "speech_16b_stereo_44kHz.raw"; | 48 const char kSpeechFile_16b_s_44k[] = "speech_16b_stereo_44kHz.raw"; |
| 49 const char kSpeechFile_16b_m_44k[] = "speech_16b_mono_44kHz.raw"; | 49 const char kSpeechFile_16b_m_44k[] = "speech_16b_mono_44kHz.raw"; |
| 50 | 50 |
| 51 const float kCallbackTestTimeMs = 2000.0; | 51 const float kCallbackTestTimeMs = 2000.0; |
| 52 const int kBitsPerSample = 16; | 52 const int kBitsPerSample = 16; |
| (...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 946 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(20)); | 946 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(20)); |
| 947 printf("\n"); | 947 printf("\n"); |
| 948 StopAndCloseAudioOutputStreamOnAudioThread(); | 948 StopAndCloseAudioOutputStreamOnAudioThread(); |
| 949 StopAndCloseAudioInputStreamOnAudioThread(); | 949 StopAndCloseAudioInputStreamOnAudioThread(); |
| 950 } | 950 } |
| 951 | 951 |
| 952 INSTANTIATE_TEST_CASE_P(AudioAndroidInputTest, AudioAndroidInputTest, | 952 INSTANTIATE_TEST_CASE_P(AudioAndroidInputTest, AudioAndroidInputTest, |
| 953 testing::ValuesIn(RunAudioRecordInputPathTests())); | 953 testing::ValuesIn(RunAudioRecordInputPathTests())); |
| 954 | 954 |
| 955 } // namespace media | 955 } // namespace media |
| OLD | NEW |