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

Side by Side Diff: media/blink/webaudiosourceprovider_impl_unittest.cc

Issue 2815303006: Convert MediaLog from being ref counted to owned by WebMediaPlayer. (Closed)
Patch Set: Rebase. Created 3 years, 8 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 | « media/blink/webaudiosourceprovider_impl.cc ('k') | media/blink/webencryptedmediaclient_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 11 matching lines...) Expand all
22 namespace media { 22 namespace media {
23 23
24 namespace { 24 namespace {
25 const float kTestVolume = 0.25; 25 const float kTestVolume = 0.25;
26 const int kSampleRate = 48000; 26 const int kSampleRate = 48000;
27 27
28 class WebAudioSourceProviderImplUnderTest : public WebAudioSourceProviderImpl { 28 class WebAudioSourceProviderImplUnderTest : public WebAudioSourceProviderImpl {
29 public: 29 public:
30 WebAudioSourceProviderImplUnderTest( 30 WebAudioSourceProviderImplUnderTest(
31 scoped_refptr<SwitchableAudioRendererSink> sink) 31 scoped_refptr<SwitchableAudioRendererSink> sink)
32 : WebAudioSourceProviderImpl(std::move(sink), new MediaLog()), 32 : WebAudioSourceProviderImpl(std::move(sink), &media_log_),
33 fallback_sink_(new MockAudioRendererSink()) {} 33 fallback_sink_(new MockAudioRendererSink()) {}
34 34
35 MockAudioRendererSink* fallback_sink() { return fallback_sink_.get(); } 35 MockAudioRendererSink* fallback_sink() { return fallback_sink_.get(); }
36 36
37 protected: 37 protected:
38 scoped_refptr<SwitchableAudioRendererSink> CreateFallbackSink() override { 38 scoped_refptr<SwitchableAudioRendererSink> CreateFallbackSink() override {
39 return fallback_sink_; 39 return fallback_sink_;
40 } 40 }
41 41
42 private: 42 private:
43 ~WebAudioSourceProviderImplUnderTest() override = default; 43 ~WebAudioSourceProviderImplUnderTest() override = default;
44 MediaLog media_log_;
44 scoped_refptr<MockAudioRendererSink> fallback_sink_; 45 scoped_refptr<MockAudioRendererSink> fallback_sink_;
45 46
46 DISALLOW_COPY_AND_ASSIGN(WebAudioSourceProviderImplUnderTest); 47 DISALLOW_COPY_AND_ASSIGN(WebAudioSourceProviderImplUnderTest);
47 }; 48 };
48 49
49 enum class WaspSinkStatus { WASP_SINK_OK, WASP_SINK_ERROR, WASP_SINK_NULL }; 50 enum class WaspSinkStatus { WASP_SINK_OK, WASP_SINK_ERROR, WASP_SINK_NULL };
50 51
51 scoped_refptr<MockAudioRendererSink> CreateWaspMockSink(WaspSinkStatus status) { 52 scoped_refptr<MockAudioRendererSink> CreateWaspMockSink(WaspSinkStatus status) {
52 if (status == WaspSinkStatus::WASP_SINK_NULL) 53 if (status == WaspSinkStatus::WASP_SINK_NULL)
53 return nullptr; 54 return nullptr;
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 } 343 }
343 344
344 INSTANTIATE_TEST_CASE_P( 345 INSTANTIATE_TEST_CASE_P(
345 /* prefix intentionally left blank due to only one parameterization */, 346 /* prefix intentionally left blank due to only one parameterization */,
346 WebAudioSourceProviderImplTest, 347 WebAudioSourceProviderImplTest,
347 testing::Values(WaspSinkStatus::WASP_SINK_OK, 348 testing::Values(WaspSinkStatus::WASP_SINK_OK,
348 WaspSinkStatus::WASP_SINK_ERROR, 349 WaspSinkStatus::WASP_SINK_ERROR,
349 WaspSinkStatus::WASP_SINK_NULL)); 350 WaspSinkStatus::WASP_SINK_NULL));
350 351
351 } // namespace media 352 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/webaudiosourceprovider_impl.cc ('k') | media/blink/webencryptedmediaclient_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698