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

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

Issue 2333983002: Reduce number of active codecs on low end devices. (Closed)
Patch Set: Fix windows. Created 4 years, 3 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_impl.cc ('k') | media/gpu/android_video_decode_accelerator.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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 TEST_F(WebMediaPlayerImplTest, ConstructAndDestroy) { 269 TEST_F(WebMediaPlayerImplTest, ConstructAndDestroy) {
270 InitializeDefaultWebMediaPlayerImpl(); 270 InitializeDefaultWebMediaPlayerImpl();
271 } 271 }
272 272
273 TEST_F(WebMediaPlayerImplTest, DidLoadingProgressClearsIdle) { 273 TEST_F(WebMediaPlayerImplTest, DidLoadingProgressClearsIdle) {
274 testing::StrictMock<MockWebMediaPlayerDelegate> strict_delegate; 274 testing::StrictMock<MockWebMediaPlayerDelegate> strict_delegate;
275 EXPECT_CALL(strict_delegate, AddObserver(_)); 275 EXPECT_CALL(strict_delegate, AddObserver(_));
276 EXPECT_CALL(strict_delegate, IsPlayingBackgroundVideo()).Times(AnyNumber()); 276 EXPECT_CALL(strict_delegate, IsPlayingBackgroundVideo()).Times(AnyNumber());
277 InitializeWebMediaPlayerImpl(strict_delegate.AsWeakPtr()); 277 InitializeWebMediaPlayerImpl(strict_delegate.AsWeakPtr());
278 EXPECT_FALSE(IsSuspended()); 278 EXPECT_FALSE(IsSuspended());
279 EXPECT_CALL(strict_delegate, PlayerGone(0));
280 wmpi_->OnSuspendRequested(false); 279 wmpi_->OnSuspendRequested(false);
281 base::RunLoop().RunUntilIdle(); 280 base::RunLoop().RunUntilIdle();
282 EXPECT_TRUE(IsSuspended()); 281 EXPECT_TRUE(IsSuspended());
283 AddBufferedRanges(); 282 AddBufferedRanges();
284 EXPECT_CALL(strict_delegate, PlayerGone(0));
285 wmpi_->didLoadingProgress(); 283 wmpi_->didLoadingProgress();
286 base::RunLoop().RunUntilIdle(); 284 base::RunLoop().RunUntilIdle();
287 EXPECT_FALSE(IsSuspended()); 285 EXPECT_FALSE(IsSuspended());
288 } 286 }
289 287
290 TEST_F(WebMediaPlayerImplTest, ComputePlayState_AfterConstruction) { 288 TEST_F(WebMediaPlayerImplTest, ComputePlayState_AfterConstruction) {
291 InitializeDefaultWebMediaPlayerImpl(); 289 InitializeDefaultWebMediaPlayerImpl();
292 WebMediaPlayerImpl::PlayState state; 290 WebMediaPlayerImpl::PlayState state;
293 291
294 state = ComputePlayState(); 292 state = ComputePlayState();
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 EXPECT_CALL(delegate_, IsPlayingBackgroundVideo()).WillOnce(Return(false)); 649 EXPECT_CALL(delegate_, IsPlayingBackgroundVideo()).WillOnce(Return(false));
652 EXPECT_CALL(delegate_, IsHidden()).WillRepeatedly(Return(true)); 650 EXPECT_CALL(delegate_, IsHidden()).WillRepeatedly(Return(true));
653 651
654 state = ComputeBackgroundedPlayState(); 652 state = ComputeBackgroundedPlayState();
655 EXPECT_EQ(WebMediaPlayerImpl::DelegateState::PAUSED, state.delegate_state); 653 EXPECT_EQ(WebMediaPlayerImpl::DelegateState::PAUSED, state.delegate_state);
656 EXPECT_FALSE(state.is_memory_reporting_enabled); 654 EXPECT_FALSE(state.is_memory_reporting_enabled);
657 EXPECT_TRUE(state.is_suspended); 655 EXPECT_TRUE(state.is_suspended);
658 } 656 }
659 657
660 } // namespace media 658 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/webmediaplayer_impl.cc ('k') | media/gpu/android_video_decode_accelerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698