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

Side by Side Diff: chromecast/media/audio/cast_audio_output_stream_unittest.cc

Issue 2060833002: Implementation of 'AudioContext.getOutputTimestamp' method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added implementation for ALSA. Created 4 years, 5 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 | « no previous file | components/audio_modem/audio_player_impl.h » ('j') | media/audio/audio_io.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chromecast/media/audio/cast_audio_output_stream.h" 5 #include "chromecast/media/audio/cast_audio_output_stream.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "chromecast/base/metrics/cast_metrics_test_helper.h" 9 #include "chromecast/base/metrics/cast_metrics_test_helper.h"
10 #include "chromecast/media/audio/cast_audio_manager.h" 10 #include "chromecast/media/audio/cast_audio_manager.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 class FakeAudioSourceCallback 148 class FakeAudioSourceCallback
149 : public ::media::AudioOutputStream::AudioSourceCallback { 149 : public ::media::AudioOutputStream::AudioSourceCallback {
150 public: 150 public:
151 FakeAudioSourceCallback() : error_(false) {} 151 FakeAudioSourceCallback() : error_(false) {}
152 152
153 bool error() const { return error_; } 153 bool error() const { return error_; }
154 154
155 // ::media::AudioOutputStream::AudioSourceCallback overrides. 155 // ::media::AudioOutputStream::AudioSourceCallback overrides.
156 int OnMoreData(::media::AudioBus* audio_bus, 156 int OnMoreData(::media::AudioBus* audio_bus,
157 uint32_t total_bytes_delay, 157 uint32_t total_bytes_delay,
158 uint32_t frames_skipped) override { 158 uint32_t frames_skipped,
159 const ::media::AudioTimestamp& timestamp = {0,0}) override {
159 audio_bus->Zero(); 160 audio_bus->Zero();
160 return audio_bus->frames(); 161 return audio_bus->frames();
161 } 162 }
162 void OnError(::media::AudioOutputStream* stream) override { error_ = true; } 163 void OnError(::media::AudioOutputStream* stream) override { error_ = true; }
163 164
164 private: 165 private:
165 bool error_; 166 bool error_;
166 }; 167 };
167 168
168 class FakeAudioManager : public CastAudioManager { 169 class FakeAudioManager : public CastAudioManager {
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 TEST_F(CastAudioOutputStreamTest, CloseWithoutStart) { 516 TEST_F(CastAudioOutputStreamTest, CloseWithoutStart) {
516 ::media::AudioOutputStream* stream = CreateStream(); 517 ::media::AudioOutputStream* stream = CreateStream();
517 ASSERT_TRUE(stream); 518 ASSERT_TRUE(stream);
518 ASSERT_TRUE(stream->Open()); 519 ASSERT_TRUE(stream->Open());
519 stream->Close(); 520 stream->Close();
520 } 521 }
521 522
522 } // namespace 523 } // namespace
523 } // namespace media 524 } // namespace media
524 } // namespace chromecast 525 } // namespace chromecast
OLDNEW
« no previous file with comments | « no previous file | components/audio_modem/audio_player_impl.h » ('j') | media/audio/audio_io.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698