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

Unified Diff: media/blink/webmediaplayer_impl_unittest.cc

Issue 2611333003: [Video] Disable bg optimization if avg keyframe distance is >10s (Closed)
Patch Set: Rebase the test 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') | media/filters/decoder_stream.cc » ('j') | 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 0d7a8280a32849f856b7672a9cd0fff2df239eaf..a58b32bd60142d5a9894e1674673d53f8673fade 100644
--- a/media/blink/webmediaplayer_impl_unittest.cc
+++ b/media/blink/webmediaplayer_impl_unittest.cc
@@ -263,6 +263,12 @@ class WebMediaPlayerImplTest : public testing::Test {
return wmpi_->ShouldDisableVideoWhenHidden();
}
+ void SetVideoKeyframeDistanceAverage(base::TimeDelta value) {
+ PipelineStatistics statistics;
+ statistics.video_keyframe_distance_average = value;
+ wmpi_->SetPipelineStatisticsForTest(statistics);
+ }
+
// "Renderer" thread.
base::MessageLoop message_loop_;
@@ -775,6 +781,7 @@ TEST_F(WebMediaPlayerImplTest, ShouldDisableVideoWhenHidden) {
SetBackgroundVideoOptimization(true);
SetMetadata(true, true);
+ SetVideoKeyframeDistanceAverage(base::TimeDelta::FromSeconds(5));
EXPECT_TRUE(ShouldDisableVideoWhenHidden());
SetMetadata(false, true);
@@ -782,6 +789,10 @@ TEST_F(WebMediaPlayerImplTest, ShouldDisableVideoWhenHidden) {
SetMetadata(true, false);
EXPECT_FALSE(ShouldDisableVideoWhenHidden());
+
+ SetVideoKeyframeDistanceAverage(base::TimeDelta::FromSeconds(100));
+ SetMetadata(true, true);
+ EXPECT_FALSE(ShouldDisableVideoWhenHidden());
}
TEST_F(WebMediaPlayerImplTest, ShouldDisableVideoWhenHiddenFeatureDisabled) {
« no previous file with comments | « media/blink/webmediaplayer_impl.cc ('k') | media/filters/decoder_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698