OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/synchronization/waitable_event.h" | 6 #include "base/synchronization/waitable_event.h" |
7 #include "chromecast/base/metrics/cast_metrics_test_helper.h" | 7 #include "chromecast/base/metrics/cast_metrics_test_helper.h" |
8 #include "chromecast/media/audio/cast_audio_manager.h" | 8 #include "chromecast/media/audio/cast_audio_manager.h" |
9 #include "chromecast/media/audio/cast_audio_output_stream.h" | 9 #include "chromecast/media/audio/cast_audio_output_stream.h" |
10 #include "chromecast/media/base/media_message_loop.h" | 10 #include "chromecast/media/base/media_message_loop.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 158 |
159 class FakeAudioSourceCallback | 159 class FakeAudioSourceCallback |
160 : public ::media::AudioOutputStream::AudioSourceCallback { | 160 : public ::media::AudioOutputStream::AudioSourceCallback { |
161 public: | 161 public: |
162 FakeAudioSourceCallback() : error_(false) {} | 162 FakeAudioSourceCallback() : error_(false) {} |
163 | 163 |
164 bool error() const { return error_; } | 164 bool error() const { return error_; } |
165 | 165 |
166 // ::media::AudioOutputStream::AudioSourceCallback overrides. | 166 // ::media::AudioOutputStream::AudioSourceCallback overrides. |
167 int OnMoreData(::media::AudioBus* audio_bus, | 167 int OnMoreData(::media::AudioBus* audio_bus, |
168 uint32_t total_bytes_delay, | 168 uint32 total_bytes_delay) override { |
169 uint32_t frames_skipped) override { | |
170 audio_bus->Zero(); | 169 audio_bus->Zero(); |
171 return audio_bus->frames(); | 170 return audio_bus->frames(); |
172 } | 171 } |
173 void OnError(::media::AudioOutputStream* stream) override { error_ = true; } | 172 void OnError(::media::AudioOutputStream* stream) override { error_ = true; } |
174 | 173 |
175 private: | 174 private: |
176 bool error_; | 175 bool error_; |
177 }; | 176 }; |
178 | 177 |
179 class FakeAudioManager : public CastAudioManager { | 178 class FakeAudioManager : public CastAudioManager { |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 TEST_F(CastAudioOutputStreamTest, CloseWithoutStart) { | 640 TEST_F(CastAudioOutputStreamTest, CloseWithoutStart) { |
642 ::media::AudioOutputStream* stream = CreateStream(); | 641 ::media::AudioOutputStream* stream = CreateStream(); |
643 ASSERT_TRUE(stream); | 642 ASSERT_TRUE(stream); |
644 ASSERT_TRUE(OpenStream(stream)); | 643 ASSERT_TRUE(OpenStream(stream)); |
645 CloseStream(stream); | 644 CloseStream(stream); |
646 } | 645 } |
647 | 646 |
648 } // namespace | 647 } // namespace |
649 } // namespace media | 648 } // namespace media |
650 } // namespace chromecast | 649 } // namespace chromecast |
OLD | NEW |