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

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

Issue 1100763002: Inject CanAddURLToHistory into TopSitesImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prefs
Patch Set: Fix error introduced during rebase Created 5 years, 7 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
« no previous file with comments | « media/audio/openbsd/audio_manager_openbsd.h ('k') | media/base/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 num_received_audio_frames_(0) {} 55 num_received_audio_frames_(0) {}
56 56
57 bool error() const { return error_; } 57 bool error() const { return error_; }
58 int num_received_audio_frames() const { return num_received_audio_frames_; } 58 int num_received_audio_frames() const { return num_received_audio_frames_; }
59 59
60 // Waits until OnData() is called on another thread. 60 // Waits until OnData() is called on another thread.
61 void WaitForData() { 61 void WaitForData() {
62 data_event_.Wait(); 62 data_event_.Wait();
63 } 63 }
64 64
65 virtual void OnData(AudioInputStream* stream, 65 void OnData(AudioInputStream* stream,
66 const AudioBus* src, 66 const AudioBus* src,
67 uint32 hardware_delay_bytes, 67 uint32 hardware_delay_bytes,
68 double volume) override { 68 double volume) override {
69 EXPECT_NE(hardware_delay_bytes, 0u); 69 EXPECT_NE(hardware_delay_bytes, 0u);
70 num_received_audio_frames_ += src->frames(); 70 num_received_audio_frames_ += src->frames();
71 data_event_.Signal(); 71 data_event_.Signal();
72 } 72 }
73 73
74 virtual void OnError(AudioInputStream* stream) override { 74 void OnError(AudioInputStream* stream) override {
75 error_ = true; 75 error_ = true;
76 } 76 }
77 77
78 private: 78 private:
79 int num_received_audio_frames_; 79 int num_received_audio_frames_;
80 base::WaitableEvent data_event_; 80 base::WaitableEvent data_event_;
81 bool error_; 81 bool error_;
82 82
83 DISALLOW_COPY_AND_ASSIGN(FakeAudioInputCallback); 83 DISALLOW_COPY_AND_ASSIGN(FakeAudioInputCallback);
84 }; 84 };
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 WriteToFileAudioSink file_sink(file_name, aisw.bits_per_sample()); 466 WriteToFileAudioSink file_sink(file_name, aisw.bits_per_sample());
467 VLOG(0) << ">> Speak into the default microphone while recording."; 467 VLOG(0) << ">> Speak into the default microphone while recording.";
468 ais->Start(&file_sink); 468 ais->Start(&file_sink);
469 base::PlatformThread::Sleep(TestTimeouts::action_timeout()); 469 base::PlatformThread::Sleep(TestTimeouts::action_timeout());
470 ais->Stop(); 470 ais->Stop();
471 VLOG(0) << ">> Recording has stopped."; 471 VLOG(0) << ">> Recording has stopped.";
472 ais.Close(); 472 ais.Close();
473 } 473 }
474 474
475 } // namespace media 475 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/openbsd/audio_manager_openbsd.h ('k') | media/base/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698