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

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

Issue 2338223003: Unassociating MediaSession from media players (in blink & content) (Closed)
Patch Set: fixed tests Created 4 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 | « media/blink/webmediaplayer_cast_android.cc ('k') | media/blink/webmediaplayer_params.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 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 wmpi_.reset(new WebMediaPlayerImpl( 132 wmpi_.reset(new WebMediaPlayerImpl(
133 web_local_frame_, &client_, nullptr, delegate, 133 web_local_frame_, &client_, nullptr, delegate,
134 base::MakeUnique<DefaultRendererFactory>( 134 base::MakeUnique<DefaultRendererFactory>(
135 media_log_, nullptr, DefaultRendererFactory::GetGpuFactoriesCB()), 135 media_log_, nullptr, DefaultRendererFactory::GetGpuFactoriesCB()),
136 url_index_, 136 url_index_,
137 WebMediaPlayerParams( 137 WebMediaPlayerParams(
138 WebMediaPlayerParams::DeferLoadCB(), 138 WebMediaPlayerParams::DeferLoadCB(),
139 scoped_refptr<SwitchableAudioRendererSink>(), media_log_, 139 scoped_refptr<SwitchableAudioRendererSink>(), media_log_,
140 media_thread_.task_runner(), message_loop_.task_runner(), 140 media_thread_.task_runner(), message_loop_.task_runner(),
141 message_loop_.task_runner(), WebMediaPlayerParams::Context3DCB(), 141 message_loop_.task_runner(), WebMediaPlayerParams::Context3DCB(),
142 base::Bind(&OnAdjustAllocatedMemory), nullptr, nullptr, nullptr))); 142 base::Bind(&OnAdjustAllocatedMemory), nullptr, nullptr)));
143 } 143 }
144 144
145 ~WebMediaPlayerImplTest() override { 145 ~WebMediaPlayerImplTest() override {
146 // Destruct WebMediaPlayerImpl and pump the message loop to ensure that 146 // Destruct WebMediaPlayerImpl and pump the message loop to ensure that
147 // objects passed to the message loop for destruction are released. 147 // objects passed to the message loop for destruction are released.
148 // 148 //
149 // NOTE: This should be done before any other member variables are 149 // NOTE: This should be done before any other member variables are
150 // destructed since WMPI may reference them during destruction. 150 // destructed since WMPI may reference them during destruction.
151 wmpi_.reset(); 151 wmpi_.reset();
152 base::RunLoop().RunUntilIdle(); 152 base::RunLoop().RunUntilIdle();
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 EXPECT_CALL(delegate_, IsPlayingBackgroundVideo()).WillOnce(Return(false)); 649 EXPECT_CALL(delegate_, IsPlayingBackgroundVideo()).WillOnce(Return(false));
650 EXPECT_CALL(delegate_, IsHidden()).WillRepeatedly(Return(true)); 650 EXPECT_CALL(delegate_, IsHidden()).WillRepeatedly(Return(true));
651 651
652 state = ComputeBackgroundedPlayState(); 652 state = ComputeBackgroundedPlayState();
653 EXPECT_EQ(WebMediaPlayerImpl::DelegateState::PAUSED, state.delegate_state); 653 EXPECT_EQ(WebMediaPlayerImpl::DelegateState::PAUSED, state.delegate_state);
654 EXPECT_FALSE(state.is_memory_reporting_enabled); 654 EXPECT_FALSE(state.is_memory_reporting_enabled);
655 EXPECT_TRUE(state.is_suspended); 655 EXPECT_TRUE(state.is_suspended);
656 } 656 }
657 657
658 } // namespace media 658 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/webmediaplayer_cast_android.cc ('k') | media/blink/webmediaplayer_params.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698