OLD | NEW |
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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 wmpi_.reset(new WebMediaPlayerImpl( | 201 wmpi_.reset(new WebMediaPlayerImpl( |
202 web_local_frame_, &client_, nullptr, delegate_.AsWeakPtr(), | 202 web_local_frame_, &client_, nullptr, delegate_.AsWeakPtr(), |
203 base::MakeUnique<DefaultRendererFactory>( | 203 base::MakeUnique<DefaultRendererFactory>( |
204 media_log_, nullptr, DefaultRendererFactory::GetGpuFactoriesCB()), | 204 media_log_, nullptr, DefaultRendererFactory::GetGpuFactoriesCB()), |
205 url_index_, | 205 url_index_, |
206 WebMediaPlayerParams( | 206 WebMediaPlayerParams( |
207 WebMediaPlayerParams::DeferLoadCB(), | 207 WebMediaPlayerParams::DeferLoadCB(), |
208 scoped_refptr<SwitchableAudioRendererSink>(), media_log_, | 208 scoped_refptr<SwitchableAudioRendererSink>(), media_log_, |
209 media_thread_.task_runner(), message_loop_.task_runner(), | 209 media_thread_.task_runner(), message_loop_.task_runner(), |
210 message_loop_.task_runner(), WebMediaPlayerParams::Context3DCB(), | 210 message_loop_.task_runner(), WebMediaPlayerParams::Context3DCB(), |
211 base::Bind(&OnAdjustAllocatedMemory), nullptr, nullptr, nullptr))); | 211 base::Bind(&OnAdjustAllocatedMemory), nullptr, nullptr, nullptr, |
| 212 base::TimeDelta::FromSeconds(10)))); |
212 } | 213 } |
213 | 214 |
214 ~WebMediaPlayerImplTest() override { | 215 ~WebMediaPlayerImplTest() override { |
215 // Destruct WebMediaPlayerImpl and pump the message loop to ensure that | 216 // Destruct WebMediaPlayerImpl and pump the message loop to ensure that |
216 // objects passed to the message loop for destruction are released. | 217 // objects passed to the message loop for destruction are released. |
217 // | 218 // |
218 // NOTE: This should be done before any other member variables are | 219 // NOTE: This should be done before any other member variables are |
219 // destructed since WMPI may reference them during destruction. | 220 // destructed since WMPI may reference them during destruction. |
220 wmpi_.reset(); | 221 wmpi_.reset(); |
221 base::RunLoop().RunUntilIdle(); | 222 base::RunLoop().RunUntilIdle(); |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 | 760 |
760 // Average keyframe distance is too big. | 761 // Average keyframe distance is too big. |
761 SetVideoKeyframeDistanceAverage(base::TimeDelta::FromSeconds(100)); | 762 SetVideoKeyframeDistanceAverage(base::TimeDelta::FromSeconds(100)); |
762 SetDuration(base::TimeDelta::FromSeconds(300)); | 763 SetDuration(base::TimeDelta::FromSeconds(300)); |
763 EXPECT_FALSE(IsBackgroundOptimizationCandidate()); | 764 EXPECT_FALSE(IsBackgroundOptimizationCandidate()); |
764 EXPECT_FALSE(ShouldPauseVideoWhenHidden()); | 765 EXPECT_FALSE(ShouldPauseVideoWhenHidden()); |
765 EXPECT_FALSE(ShouldDisableVideoWhenHidden()); | 766 EXPECT_FALSE(ShouldDisableVideoWhenHidden()); |
766 } | 767 } |
767 | 768 |
768 } // namespace media | 769 } // namespace media |
OLD | NEW |