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

Side by Side Diff: media/audio/audio_output_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 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/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 .WillOnce(SignalEvent(&play_event_)); 217 .WillOnce(SignalEvent(&play_event_));
218 } 218 }
219 219
220 controller_->SwitchOutputDevice(AudioManager::GetDefaultDeviceName(), 220 controller_->SwitchOutputDevice(AudioManager::GetDefaultDeviceName(),
221 base::Bind(&base::DoNothing)); 221 base::Bind(&base::DoNothing));
222 } 222 }
223 223
224 void Close() { 224 void Close() {
225 EXPECT_CALL(mock_sync_reader_, Close()); 225 EXPECT_CALL(mock_sync_reader_, Close());
226 226
227 controller_->Close(base::MessageLoop::QuitClosure()); 227 controller_->Close(base::MessageLoop::QuitWhenIdleClosure());
228 base::MessageLoop::current()->Run(); 228 base::MessageLoop::current()->Run();
229 } 229 }
230 230
231 // These help make test sequences more readable. 231 // These help make test sequences more readable.
232 void DivertNeverPlaying() { Divert(false, 0); } 232 void DivertNeverPlaying() { Divert(false, 0); }
233 void DivertWillEventuallyBeTwicePlayed() { Divert(false, 2); } 233 void DivertWillEventuallyBeTwicePlayed() { Divert(false, 2); }
234 void DivertWhilePlaying() { Divert(true, 1); } 234 void DivertWhilePlaying() { Divert(true, 1); }
235 void RevertWasNotPlaying() { Revert(false); } 235 void RevertWasNotPlaying() { Revert(false); }
236 void RevertWhilePlaying() { Revert(true); } 236 void RevertWhilePlaying() { Revert(true); }
237 237
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 403
404 TEST_F(AudioOutputControllerTest, DivertRevertClose) { 404 TEST_F(AudioOutputControllerTest, DivertRevertClose) {
405 Create(kSamplesPerPacket); 405 Create(kSamplesPerPacket);
406 WaitForCreate(); 406 WaitForCreate();
407 DivertNeverPlaying(); 407 DivertNeverPlaying();
408 RevertWasNotPlaying(); 408 RevertWasNotPlaying();
409 Close(); 409 Close();
410 } 410 }
411 411
412 } // namespace media 412 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/audio_low_latency_input_output_unittest.cc ('k') | media/audio/audio_output_device_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698