Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(585)

Side by Side Diff: media/audio/audio_input_unittest.cc

Issue 11546002: Merge 171701 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1271_97/src/
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | media/audio/mac/audio_input_mac.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | media/audio/mac/audio_input_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698