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

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

Issue 2449873006: Don't background pause suspend until we have future data. (Closed)
Patch Set: Reword comments, remove test. Created 4 years, 1 month 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') | no next file » | 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 EXPECT_FALSE(state.is_suspended); 293 EXPECT_FALSE(state.is_suspended);
294 294
295 state = ComputeIdlePlayState(); 295 state = ComputeIdlePlayState();
296 EXPECT_EQ(WebMediaPlayerImpl::DelegateState::GONE, state.delegate_state); 296 EXPECT_EQ(WebMediaPlayerImpl::DelegateState::GONE, state.delegate_state);
297 EXPECT_FALSE(state.is_memory_reporting_enabled); 297 EXPECT_FALSE(state.is_memory_reporting_enabled);
298 EXPECT_TRUE(state.is_suspended); 298 EXPECT_TRUE(state.is_suspended);
299 299
300 state = ComputeBackgroundedPlayState(); 300 state = ComputeBackgroundedPlayState();
301 EXPECT_EQ(WebMediaPlayerImpl::DelegateState::GONE, state.delegate_state); 301 EXPECT_EQ(WebMediaPlayerImpl::DelegateState::GONE, state.delegate_state);
302 EXPECT_FALSE(state.is_memory_reporting_enabled); 302 EXPECT_FALSE(state.is_memory_reporting_enabled);
303 EXPECT_TRUE(state.is_suspended); 303 EXPECT_FALSE(state.is_suspended);
304 304
305 state = ComputeMustSuspendPlayState(); 305 state = ComputeMustSuspendPlayState();
306 EXPECT_EQ(WebMediaPlayerImpl::DelegateState::GONE, state.delegate_state); 306 EXPECT_EQ(WebMediaPlayerImpl::DelegateState::GONE, state.delegate_state);
307 EXPECT_FALSE(state.is_memory_reporting_enabled); 307 EXPECT_FALSE(state.is_memory_reporting_enabled);
308 EXPECT_TRUE(state.is_suspended); 308 EXPECT_TRUE(state.is_suspended);
309 } 309 }
310 310
311 TEST_F(WebMediaPlayerImplTest, ComputePlayState_AfterMetadata) { 311 TEST_F(WebMediaPlayerImplTest, ComputePlayState_AfterMetadata) {
312 InitializeDefaultWebMediaPlayerImpl(); 312 InitializeDefaultWebMediaPlayerImpl();
313 WebMediaPlayerImpl::PlayState state; 313 WebMediaPlayerImpl::PlayState state;
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 EXPECT_CALL(delegate_, IsPlayingBackgroundVideo()).WillOnce(Return(false)); 647 EXPECT_CALL(delegate_, IsPlayingBackgroundVideo()).WillOnce(Return(false));
648 EXPECT_CALL(delegate_, IsHidden()).WillRepeatedly(Return(true)); 648 EXPECT_CALL(delegate_, IsHidden()).WillRepeatedly(Return(true));
649 649
650 state = ComputeBackgroundedPlayState(); 650 state = ComputeBackgroundedPlayState();
651 EXPECT_EQ(WebMediaPlayerImpl::DelegateState::PAUSED, state.delegate_state); 651 EXPECT_EQ(WebMediaPlayerImpl::DelegateState::PAUSED, state.delegate_state);
652 EXPECT_FALSE(state.is_memory_reporting_enabled); 652 EXPECT_FALSE(state.is_memory_reporting_enabled);
653 EXPECT_TRUE(state.is_suspended); 653 EXPECT_TRUE(state.is_suspended);
654 } 654 }
655 655
656 } // namespace media 656 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/webmediaplayer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698