| 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 total_bytes_delay) override { | 168 uint32_t total_bytes_delay, |
| 169 uint32_t frames_skipped) override { |
| 169 audio_bus->Zero(); | 170 audio_bus->Zero(); |
| 170 return audio_bus->frames(); | 171 return audio_bus->frames(); |
| 171 } | 172 } |
| 172 void OnError(::media::AudioOutputStream* stream) override { error_ = true; } | 173 void OnError(::media::AudioOutputStream* stream) override { error_ = true; } |
| 173 | 174 |
| 174 private: | 175 private: |
| 175 bool error_; | 176 bool error_; |
| 176 }; | 177 }; |
| 177 | 178 |
| 178 class FakeAudioManager : public CastAudioManager { | 179 class FakeAudioManager : public CastAudioManager { |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 TEST_F(CastAudioOutputStreamTest, CloseWithoutStart) { | 641 TEST_F(CastAudioOutputStreamTest, CloseWithoutStart) { |
| 641 ::media::AudioOutputStream* stream = CreateStream(); | 642 ::media::AudioOutputStream* stream = CreateStream(); |
| 642 ASSERT_TRUE(stream); | 643 ASSERT_TRUE(stream); |
| 643 ASSERT_TRUE(OpenStream(stream)); | 644 ASSERT_TRUE(OpenStream(stream)); |
| 644 CloseStream(stream); | 645 CloseStream(stream); |
| 645 } | 646 } |
| 646 | 647 |
| 647 } // namespace | 648 } // namespace |
| 648 } // namespace media | 649 } // namespace media |
| 649 } // namespace chromecast | 650 } // namespace chromecast |
| OLD | NEW |