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

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

Issue 1396113004: Don't use base::MessageLoop::{Quit,QuitClosure} in media/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months 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
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/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
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
OLDNEW
« no previous file with comments | « media/audio/audio_input_controller_unittest.cc ('k') | media/audio/audio_low_latency_input_output_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698