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

Unified Diff: media/audio/audio_input_controller_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/android/audio_android_unittest.cc ('k') | media/audio/audio_input_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_input_controller_unittest.cc
diff --git a/media/audio/audio_input_controller_unittest.cc b/media/audio/audio_input_controller_unittest.cc
index 05d12fca642da350c3c7113822c95e760b26c28a..3f14ae4716adf01ea643b06e9d7e54f8b4fc2daf 100644
--- a/media/audio/audio_input_controller_unittest.cc
+++ b/media/audio/audio_input_controller_unittest.cc
@@ -25,22 +25,23 @@ static const int kBitsPerSample = 16;
static const ChannelLayout kChannelLayout = CHANNEL_LAYOUT_STEREO;
static const int kSamplesPerPacket = kSampleRate / 10;
-// Posts base::MessageLoop::QuitClosure() on specified message loop.
+// Posts base::MessageLoop::QuitWhenIdleClosure() on specified message loop.
ACTION_P(QuitMessageLoop, loop_or_proxy) {
- loop_or_proxy->PostTask(FROM_HERE, base::MessageLoop::QuitClosure());
+ loop_or_proxy->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
}
-// Posts base::MessageLoop::QuitClosure() on specified message loop after a
-// certain number of calls given by |limit|.
+// Posts base::MessageLoop::QuitWhenIdleClosure() on specified message loop
+// after a certain number of calls given by |limit|.
ACTION_P3(CheckCountAndPostQuitTask, count, limit, loop_or_proxy) {
if (++*count >= limit) {
- loop_or_proxy->PostTask(FROM_HERE, base::MessageLoop::QuitClosure());
+ loop_or_proxy->PostTask(FROM_HERE,
+ base::MessageLoop::QuitWhenIdleClosure());
}
}
// Closes AudioOutputController synchronously.
static void CloseAudioController(AudioInputController* controller) {
- controller->Close(base::MessageLoop::QuitClosure());
+ controller->Close(base::MessageLoop::QuitWhenIdleClosure());
base::MessageLoop::current()->Run();
}
@@ -254,10 +255,10 @@ TEST_F(AudioInputControllerTest, CloseTwice) {
controller->Record();
- controller->Close(base::MessageLoop::QuitClosure());
+ controller->Close(base::MessageLoop::QuitWhenIdleClosure());
base::MessageLoop::current()->Run();
- controller->Close(base::MessageLoop::QuitClosure());
+ controller->Close(base::MessageLoop::QuitWhenIdleClosure());
base::MessageLoop::current()->Run();
}
« no previous file with comments | « media/audio/android/audio_android_unittest.cc ('k') | media/audio/audio_input_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698