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

Unified Diff: media/blink/webmediaplayer_impl_unittest.cc

Issue 2643033004: [Video, Android] Pause video only players ignoring duration and keyframes (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/blink/webmediaplayer_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webmediaplayer_impl_unittest.cc
diff --git a/media/blink/webmediaplayer_impl_unittest.cc b/media/blink/webmediaplayer_impl_unittest.cc
index 2071eed5003cedb227b2b6e44cdff944a8b7af41..d06cd7e7407b6fc59fe8fa8a901d210d64bcf504 100644
--- a/media/blink/webmediaplayer_impl_unittest.cc
+++ b/media/blink/webmediaplayer_impl_unittest.cc
@@ -738,12 +738,25 @@ TEST_F(WebMediaPlayerImplTest, BackgroundOptimizationsFeatureDisabled) {
// Video only (pausing is enabled on Android).
SetMetadata(false, true);
EXPECT_TRUE(IsBackgroundOptimizationCandidate());
+ EXPECT_FALSE(ShouldDisableVideoWhenHidden());
#if defined(OS_ANDROID)
EXPECT_TRUE(ShouldPauseVideoWhenHidden());
+
+ // On Android, the duration and keyframe distance don't matter for video-only.
+ SetDuration(base::TimeDelta::FromSeconds(5));
+ EXPECT_TRUE(IsBackgroundOptimizationCandidate());
+ EXPECT_TRUE(ShouldPauseVideoWhenHidden());
+
+ SetVideoKeyframeDistanceAverage(base::TimeDelta::FromSeconds(100));
+ SetDuration(base::TimeDelta::FromSeconds(300));
+ EXPECT_TRUE(IsBackgroundOptimizationCandidate());
+ EXPECT_TRUE(ShouldPauseVideoWhenHidden());
+
+ // Restore average keyframe distance.
+ SetVideoKeyframeDistanceAverage(base::TimeDelta::FromSeconds(5));
#else
EXPECT_FALSE(ShouldPauseVideoWhenHidden());
#endif
- EXPECT_FALSE(ShouldDisableVideoWhenHidden());
// Audio only.
SetMetadata(true, false);
« 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