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

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

Issue 2711153006: Add RendererFactorySelector (Closed)
Patch Set: Added UTs 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "media/blink/webmediaplayer_impl.h" 5 #include "media/blink/webmediaplayer_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 &web_frame_client_, 204 &web_frame_client_,
205 nullptr, 205 nullptr,
206 nullptr)), 206 nullptr)),
207 media_log_(new MediaLog()), 207 media_log_(new MediaLog()),
208 audio_parameters_(TestAudioParameters::Normal()) { 208 audio_parameters_(TestAudioParameters::Normal()) {
209 web_view_->SetMainFrame(web_local_frame_); 209 web_view_->SetMainFrame(web_local_frame_);
210 media_thread_.StartAndWaitForTesting(); 210 media_thread_.StartAndWaitForTesting();
211 } 211 }
212 212
213 void InitializeWebMediaPlayerImpl(bool allow_suspend) { 213 void InitializeWebMediaPlayerImpl(bool allow_suspend) {
214 auto factory_selector = base::MakeUnique<RendererFactorySelector>();
215 factory_selector->AddFactory(
216 RendererFactorySelector::FactoryType::DEFAULT,
217 base::MakeUnique<DefaultRendererFactory>(
218 media_log_, nullptr, DefaultRendererFactory::GetGpuFactoriesCB()));
219 factory_selector->SetBaseFactoryType(
220 RendererFactorySelector::FactoryType::DEFAULT);
221
214 wmpi_ = base::MakeUnique<WebMediaPlayerImpl>( 222 wmpi_ = base::MakeUnique<WebMediaPlayerImpl>(
215 web_local_frame_, &client_, nullptr, &delegate_, 223 web_local_frame_, &client_, nullptr, &delegate_,
216 base::MakeUnique<DefaultRendererFactory>( 224 std::move(factory_selector), url_index_,
217 media_log_, nullptr, DefaultRendererFactory::GetGpuFactoriesCB()),
218 url_index_,
219 WebMediaPlayerParams( 225 WebMediaPlayerParams(
220 WebMediaPlayerParams::DeferLoadCB(), 226 WebMediaPlayerParams::DeferLoadCB(),
221 scoped_refptr<SwitchableAudioRendererSink>(), media_log_, 227 scoped_refptr<SwitchableAudioRendererSink>(), media_log_,
222 media_thread_.task_runner(), message_loop_.task_runner(), 228 media_thread_.task_runner(), message_loop_.task_runner(),
223 message_loop_.task_runner(), WebMediaPlayerParams::Context3DCB(), 229 message_loop_.task_runner(), WebMediaPlayerParams::Context3DCB(),
224 base::Bind(&OnAdjustAllocatedMemory), nullptr, nullptr, nullptr, 230 base::Bind(&OnAdjustAllocatedMemory), nullptr, nullptr, nullptr,
225 kMaxKeyframeDistanceToDisableBackgroundVideo, 231 kMaxKeyframeDistanceToDisableBackgroundVideo,
226 kMaxKeyframeDistanceToDisableBackgroundVideoMSE, false, 232 kMaxKeyframeDistanceToDisableBackgroundVideoMSE, false,
227 allow_suspend, false)); 233 allow_suspend, false));
228 } 234 }
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 WebMediaPlayerImplBackgroundBehaviorTest, 986 WebMediaPlayerImplBackgroundBehaviorTest,
981 ::testing::Combine(::testing::Bool(), 987 ::testing::Combine(::testing::Bool(),
982 ::testing::Bool(), 988 ::testing::Bool(),
983 ::testing::Values(5, 300), 989 ::testing::Values(5, 300),
984 ::testing::Values(5, 100), 990 ::testing::Values(5, 100),
985 ::testing::Bool(), 991 ::testing::Bool(),
986 ::testing::Bool(), 992 ::testing::Bool(),
987 ::testing::Bool())); 993 ::testing::Bool()));
988 994
989 } // namespace media 995 } // namespace media
OLDNEW
« content/renderer/render_frame_impl.cc ('K') | « media/blink/webmediaplayer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698