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

Side by Side Diff: media/audio/win/audio_low_latency_input_win_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 <windows.h> 5 #include <windows.h>
6 #include <mmsystem.h> 6 #include <mmsystem.h>
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/environment.h" 9 #include "base/environment.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 14 matching lines...) Expand all
25 using ::testing::_; 25 using ::testing::_;
26 using ::testing::AnyNumber; 26 using ::testing::AnyNumber;
27 using ::testing::AtLeast; 27 using ::testing::AtLeast;
28 using ::testing::Gt; 28 using ::testing::Gt;
29 using ::testing::NotNull; 29 using ::testing::NotNull;
30 30
31 namespace media { 31 namespace media {
32 32
33 ACTION_P3(CheckCountAndPostQuitTask, count, limit, loop) { 33 ACTION_P3(CheckCountAndPostQuitTask, count, limit, loop) {
34 if (++*count >= limit) { 34 if (++*count >= limit) {
35 loop->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); 35 loop->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
36 } 36 }
37 } 37 }
38 38
39 class MockAudioInputCallback : public AudioInputStream::AudioInputCallback { 39 class MockAudioInputCallback : public AudioInputStream::AudioInputCallback {
40 public: 40 public:
41 MOCK_METHOD4(OnData, 41 MOCK_METHOD4(OnData,
42 void(AudioInputStream* stream, 42 void(AudioInputStream* stream,
43 const AudioBus* src, 43 const AudioBus* src,
44 uint32 hardware_delay_bytes, 44 uint32 hardware_delay_bytes,
45 double volume)); 45 double volume));
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 WriteToFileAudioSink file_sink(file_name, aisw.bits_per_sample()); 463 WriteToFileAudioSink file_sink(file_name, aisw.bits_per_sample());
464 VLOG(0) << ">> Speak into the default microphone while recording."; 464 VLOG(0) << ">> Speak into the default microphone while recording.";
465 ais->Start(&file_sink); 465 ais->Start(&file_sink);
466 base::PlatformThread::Sleep(TestTimeouts::action_timeout()); 466 base::PlatformThread::Sleep(TestTimeouts::action_timeout());
467 ais->Stop(); 467 ais->Stop();
468 VLOG(0) << ">> Recording has stopped."; 468 VLOG(0) << ">> Recording has stopped.";
469 ais.Close(); 469 ais.Close();
470 } 470 }
471 471
472 } // namespace media 472 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/fake_audio_worker_unittest.cc ('k') | media/audio/win/audio_low_latency_output_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698