| 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/environment.h" | 6 #include "base/environment.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/threading/platform_thread.h" | 9 #include "base/threading/platform_thread.h" |
| 10 #include "media/audio/audio_io.h" | 10 #include "media/audio/audio_io.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 AudioInputStream* ais = CreateTestAudioInputStream(audio_man.get()); | 145 AudioInputStream* ais = CreateTestAudioInputStream(audio_man.get()); |
| 146 EXPECT_TRUE(ais->Open()); | 146 EXPECT_TRUE(ais->Open()); |
| 147 | 147 |
| 148 TestInputCallback test_callback(kSamplesPerPacket * 4); | 148 TestInputCallback test_callback(kSamplesPerPacket * 4); |
| 149 ais->Start(&test_callback); | 149 ais->Start(&test_callback); |
| 150 // Verify at least 500ms worth of audio was recorded, after giving sufficient | 150 // Verify at least 500ms worth of audio was recorded, after giving sufficient |
| 151 // extra time. | 151 // extra time. |
| 152 message_loop.PostDelayedTask( | 152 message_loop.PostDelayedTask( |
| 153 FROM_HERE, | 153 FROM_HERE, |
| 154 MessageLoop::QuitClosure(), | 154 MessageLoop::QuitClosure(), |
| 155 base::TimeDelta::FromMilliseconds(590)); | 155 base::TimeDelta::FromMilliseconds(690)); |
| 156 message_loop.Run(); | 156 message_loop.Run(); |
| 157 EXPECT_GE(test_callback.callback_count(), 10); | 157 EXPECT_GE(test_callback.callback_count(), 1); |
| 158 EXPECT_FALSE(test_callback.had_error()); | 158 EXPECT_FALSE(test_callback.had_error()); |
| 159 | 159 |
| 160 ais->Stop(); | 160 ais->Stop(); |
| 161 ais->Close(); | 161 ais->Close(); |
| 162 } | 162 } |
| 163 | 163 |
| 164 } // namespace media | 164 } // namespace media |
| OLD | NEW |