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

Side by Side Diff: media/audio/win/audio_low_latency_input_win_unittest.cc

Issue 1210013007: clang/win: Fix warnings to prepare for building without -Wno-reorder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@clang-unsequenced
Patch Set: Created 5 years, 5 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
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));
46 MOCK_METHOD1(OnError, void(AudioInputStream* stream)); 46 MOCK_METHOD1(OnError, void(AudioInputStream* stream));
47 }; 47 };
48 48
49 class FakeAudioInputCallback : public AudioInputStream::AudioInputCallback { 49 class FakeAudioInputCallback : public AudioInputStream::AudioInputCallback {
50 public: 50 public:
51 FakeAudioInputCallback() 51 FakeAudioInputCallback()
52 : error_(false), 52 : num_received_audio_frames_(0),
53 data_event_(false, false), 53 data_event_(false, false),
54 num_received_audio_frames_(0) {} 54 error_(false) {}
55 55
56 bool error() const { return error_; } 56 bool error() const { return error_; }
57 int num_received_audio_frames() const { return num_received_audio_frames_; } 57 int num_received_audio_frames() const { return num_received_audio_frames_; }
58 58
59 // Waits until OnData() is called on another thread. 59 // Waits until OnData() is called on another thread.
60 void WaitForData() { 60 void WaitForData() {
61 data_event_.Wait(); 61 data_event_.Wait();
62 } 62 }
63 63
64 void OnData(AudioInputStream* stream, 64 void OnData(AudioInputStream* stream,
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 WriteToFileAudioSink file_sink(file_name, aisw.bits_per_sample()); 465 WriteToFileAudioSink file_sink(file_name, aisw.bits_per_sample());
466 VLOG(0) << ">> Speak into the default microphone while recording."; 466 VLOG(0) << ">> Speak into the default microphone while recording.";
467 ais->Start(&file_sink); 467 ais->Start(&file_sink);
468 base::PlatformThread::Sleep(TestTimeouts::action_timeout()); 468 base::PlatformThread::Sleep(TestTimeouts::action_timeout());
469 ais->Stop(); 469 ais->Stop();
470 VLOG(0) << ">> Recording has stopped."; 470 VLOG(0) << ">> Recording has stopped.";
471 ais.Close(); 471 ais.Close();
472 } 472 }
473 473
474 } // namespace media 474 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698