| 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/environment.h" | 7 #include "base/environment.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 // Test a normal recording sequence using an AudioInputStream. | 212 // Test a normal recording sequence using an AudioInputStream. |
| 213 // Very simple test which starts capturing during half a second and verifies | 213 // Very simple test which starts capturing during half a second and verifies |
| 214 // that recording starts. | 214 // that recording starts. |
| 215 TEST_F(AudioInputTest, MAYBE_Record) { | 215 TEST_F(AudioInputTest, MAYBE_Record) { |
| 216 ABORT_AUDIO_TEST_IF_NOT(InputDevicesAvailable()); | 216 ABORT_AUDIO_TEST_IF_NOT(InputDevicesAvailable()); |
| 217 MakeAudioInputStreamOnAudioThread(); | 217 MakeAudioInputStreamOnAudioThread(); |
| 218 | 218 |
| 219 TestInputCallback test_callback; | 219 TestInputCallback test_callback; |
| 220 OpenAndStartAudioInputStreamOnAudioThread(&test_callback); | 220 OpenAndStartAudioInputStreamOnAudioThread(&test_callback); |
| 221 | 221 |
| 222 message_loop_.PostDelayedTask( | 222 message_loop_.PostDelayedTask(FROM_HERE, |
| 223 FROM_HERE, | 223 base::MessageLoop::QuitWhenIdleClosure(), |
| 224 base::MessageLoop::QuitClosure(), | 224 base::TimeDelta::FromMilliseconds(500)); |
| 225 base::TimeDelta::FromMilliseconds(500)); | |
| 226 message_loop_.Run(); | 225 message_loop_.Run(); |
| 227 EXPECT_GE(test_callback.callback_count(), 2); | 226 EXPECT_GE(test_callback.callback_count(), 2); |
| 228 EXPECT_FALSE(test_callback.had_error()); | 227 EXPECT_FALSE(test_callback.had_error()); |
| 229 | 228 |
| 230 StopAndCloseAudioInputStreamOnAudioThread(); | 229 StopAndCloseAudioInputStreamOnAudioThread(); |
| 231 } | 230 } |
| 232 | 231 |
| 233 } // namespace media | 232 } // namespace media |
| OLD | NEW |