Index: components/copresence/test/audio_test_support.cc |
diff --git a/components/copresence/test/audio_test_support.cc b/components/copresence/test/audio_test_support.cc |
index b1913119e5fedbd364662cf592ea220286d11e66..98548c580644607d6d84c4644b126f734dba1654 100644 |
--- a/components/copresence/test/audio_test_support.cc |
+++ b/components/copresence/test/audio_test_support.cc |
@@ -34,4 +34,51 @@ CreateRandomAudioRefCounted(int random_seed, int channels, int samples) { |
return bus; |
} |
+// TestAudioPlayer implementation. |
+TestAudioPlayer::TestAudioPlayer() : is_playing_(false) { |
+} |
+TestAudioPlayer::~TestAudioPlayer() { |
+} |
+void TestAudioPlayer::Initialize() { |
+} |
+void TestAudioPlayer::Play( |
+ const scoped_refptr<media::AudioBusRefCounted>& /* samples */) { |
+ is_playing_ = true; |
+} |
+void TestAudioPlayer::Stop() { |
+ is_playing_ = false; |
+} |
+void TestAudioPlayer::Finalize() { |
+ delete this; |
+} |
+bool TestAudioPlayer::IsPlaying() { |
+ return is_playing_; |
+} |
+ |
+// TestAudioRecorder implementation. |
+TestAudioRecorder::TestAudioRecorder() |
+ : AudioRecorderImpl(), is_recording_(false) { |
+} |
+TestAudioRecorder::~TestAudioRecorder() { |
+} |
+void TestAudioRecorder::Initialize(const RecordedSamplesCallback& cb) { |
+ cb_ = cb; |
+} |
+void TestAudioRecorder::Record() { |
+ is_recording_ = true; |
+} |
+void TestAudioRecorder::Stop() { |
+ is_recording_ = false; |
+} |
+void TestAudioRecorder::Finalize() { |
+ delete this; |
+} |
+bool TestAudioRecorder::IsRecording() { |
+ return is_recording_; |
+} |
+void TestAudioRecorder::TriggerDecodeRequest() { |
+ if (!cb_.is_null()) |
+ cb_.Run(std::string(7, 0x1337)); |
+} |
+ |
} // namespace copresence |