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

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

Issue 1385333002: [Chromecast] Cleanup the API for creating MediaPipelineBackend. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | « chromecast/media/audio/cast_audio_output_stream.cc ('k') | no next file » | no next file with comments »
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 "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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 bool error_; 175 bool error_;
176 }; 176 };
177 177
178 class FakeAudioManager : public CastAudioManager { 178 class FakeAudioManager : public CastAudioManager {
179 public: 179 public:
180 FakeAudioManager() 180 FakeAudioManager()
181 : CastAudioManager(nullptr), media_pipeline_backend_(nullptr) {} 181 : CastAudioManager(nullptr), media_pipeline_backend_(nullptr) {}
182 ~FakeAudioManager() override {} 182 ~FakeAudioManager() override {}
183 183
184 // CastAudioManager overrides. 184 // CastAudioManager overrides.
185 scoped_ptr<MediaPipelineBackend> CreateMediaPipelineBackend() override { 185 scoped_ptr<MediaPipelineBackend> CreateMediaPipelineBackend(
186 const MediaPipelineDeviceParams& params) override {
186 DCHECK(media::MediaMessageLoop::GetTaskRunner()->BelongsToCurrentThread()); 187 DCHECK(media::MediaMessageLoop::GetTaskRunner()->BelongsToCurrentThread());
187 DCHECK(!media_pipeline_backend_); 188 DCHECK(!media_pipeline_backend_);
188 189
189 scoped_ptr<FakeMediaPipelineBackend> backend(new FakeMediaPipelineBackend); 190 scoped_ptr<FakeMediaPipelineBackend> backend(new FakeMediaPipelineBackend);
190 // Cache the backend locally to be used by tests. 191 // Cache the backend locally to be used by tests.
191 media_pipeline_backend_ = backend.get(); 192 media_pipeline_backend_ = backend.get();
192 return backend.Pass(); 193 return backend.Pass();
193 } 194 }
194 void ReleaseOutputStream(::media::AudioOutputStream* stream) override { 195 void ReleaseOutputStream(::media::AudioOutputStream* stream) override {
195 DCHECK(media_pipeline_backend_); 196 DCHECK(media_pipeline_backend_);
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 volume = GetStreamVolume(stream); 583 volume = GetStreamVolume(stream);
583 EXPECT_EQ(0.5, volume); 584 EXPECT_EQ(0.5, volume);
584 EXPECT_EQ(0.5f, audio_device->volume_multiplier()); 585 EXPECT_EQ(0.5f, audio_device->volume_multiplier());
585 586
586 CloseStream(stream); 587 CloseStream(stream);
587 } 588 }
588 589
589 } // namespace 590 } // namespace
590 } // namespace media 591 } // namespace media
591 } // namespace chromecast 592 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/media/audio/cast_audio_output_stream.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698