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

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

Issue 2204673004: WIP - WebMediaPlayer switch media renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add switching of CdmFactory. Created 4 years, 4 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 web_local_frame_, &client_, nullptr, 101 web_local_frame_, &client_, nullptr,
102 base::WeakPtr<WebMediaPlayerDelegate>(), 102 base::WeakPtr<WebMediaPlayerDelegate>(),
103 base::WrapUnique(new DefaultRendererFactory( 103 base::WrapUnique(new DefaultRendererFactory(
104 media_log_, nullptr, DefaultRendererFactory::GetGpuFactoriesCB())), 104 media_log_, nullptr, DefaultRendererFactory::GetGpuFactoriesCB())),
105 url_index_, 105 url_index_,
106 WebMediaPlayerParams( 106 WebMediaPlayerParams(
107 WebMediaPlayerParams::DeferLoadCB(), 107 WebMediaPlayerParams::DeferLoadCB(),
108 scoped_refptr<SwitchableAudioRendererSink>(), media_log_, 108 scoped_refptr<SwitchableAudioRendererSink>(), media_log_,
109 media_thread_.task_runner(), message_loop_.task_runner(), 109 media_thread_.task_runner(), message_loop_.task_runner(),
110 message_loop_.task_runner(), WebMediaPlayerParams::Context3DCB(), 110 message_loop_.task_runner(), WebMediaPlayerParams::Context3DCB(),
111 base::Bind(&OnAdjustAllocatedMemory), nullptr, nullptr, nullptr))); 111 base::Bind(&OnAdjustAllocatedMemory),
112 WebMediaPlayerParams::IsRemoteCdmCB(), nullptr, nullptr, nullptr)));
112 } 113 }
113 114
114 ~WebMediaPlayerImplTest() override { 115 ~WebMediaPlayerImplTest() override {
115 // Destruct WebMediaPlayerImpl and pump the message loop to ensure that 116 // Destruct WebMediaPlayerImpl and pump the message loop to ensure that
116 // objects passed to the message loop for destruction are released. 117 // objects passed to the message loop for destruction are released.
117 // 118 //
118 // NOTE: This should be done before any other member variables are 119 // NOTE: This should be done before any other member variables are
119 // destructed since WMPI may reference them during destruction. 120 // destructed since WMPI may reference them during destruction.
120 wmpi_.reset(); 121 wmpi_.reset();
121 base::RunLoop().RunUntilIdle(); 122 base::RunLoop().RunUntilIdle();
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 EXPECT_FALSE(state.is_suspended); 463 EXPECT_FALSE(state.is_suspended);
463 464
464 SetPaused(false); 465 SetPaused(false);
465 state = ComputePlayStateSuspended(); 466 state = ComputePlayStateSuspended();
466 EXPECT_EQ(WebMediaPlayerImpl::DelegateState::PLAYING, state.delegate_state); 467 EXPECT_EQ(WebMediaPlayerImpl::DelegateState::PLAYING, state.delegate_state);
467 EXPECT_TRUE(state.is_memory_reporting_enabled); 468 EXPECT_TRUE(state.is_memory_reporting_enabled);
468 EXPECT_FALSE(state.is_suspended); 469 EXPECT_FALSE(state.is_suspended);
469 } 470 }
470 471
471 } // namespace media 472 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698