| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 161 |
| 162 class FakeAudioSourceCallback | 162 class FakeAudioSourceCallback |
| 163 : public ::media::AudioOutputStream::AudioSourceCallback { | 163 : public ::media::AudioOutputStream::AudioSourceCallback { |
| 164 public: | 164 public: |
| 165 FakeAudioSourceCallback() : error_(false) {} | 165 FakeAudioSourceCallback() : error_(false) {} |
| 166 | 166 |
| 167 bool error() const { return error_; } | 167 bool error() const { return error_; } |
| 168 | 168 |
| 169 // ::media::AudioOutputStream::AudioSourceCallback overrides. | 169 // ::media::AudioOutputStream::AudioSourceCallback overrides. |
| 170 int OnMoreData(::media::AudioBus* audio_bus, | 170 int OnMoreData(::media::AudioBus* audio_bus, |
| 171 uint32 total_bytes_delay) override { | 171 uint32_t total_bytes_delay, |
| 172 uint32_t frames_skipped) override { |
| 172 audio_bus->Zero(); | 173 audio_bus->Zero(); |
| 173 return audio_bus->frames(); | 174 return audio_bus->frames(); |
| 174 } | 175 } |
| 175 void OnError(::media::AudioOutputStream* stream) override { error_ = true; } | 176 void OnError(::media::AudioOutputStream* stream) override { error_ = true; } |
| 176 | 177 |
| 177 private: | 178 private: |
| 178 bool error_; | 179 bool error_; |
| 179 }; | 180 }; |
| 180 | 181 |
| 181 class FakeAudioManager : public CastAudioManager { | 182 class FakeAudioManager : public CastAudioManager { |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 TEST_F(CastAudioOutputStreamTest, CloseWithoutStart) { | 644 TEST_F(CastAudioOutputStreamTest, CloseWithoutStart) { |
| 644 ::media::AudioOutputStream* stream = CreateStream(); | 645 ::media::AudioOutputStream* stream = CreateStream(); |
| 645 ASSERT_TRUE(stream); | 646 ASSERT_TRUE(stream); |
| 646 ASSERT_TRUE(OpenStream(stream)); | 647 ASSERT_TRUE(OpenStream(stream)); |
| 647 CloseStream(stream); | 648 CloseStream(stream); |
| 648 } | 649 } |
| 649 | 650 |
| 650 } // namespace | 651 } // namespace |
| 651 } // namespace media | 652 } // namespace media |
| 652 } // namespace chromecast | 653 } // namespace chromecast |
| OLD | NEW |