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

Unified Diff: media/blink/watch_time_reporter_unittest.cc

Issue 2498113004: Add audio only watch time metrics. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: media/blink/watch_time_reporter_unittest.cc
diff --git a/media/blink/watch_time_reporter_unittest.cc b/media/blink/watch_time_reporter_unittest.cc
index 6ab2957f726c1ff9960e7912af0817e091cc323a..0fc8ef24452c8e33e338a638568c59e62b2be4c3 100644
--- a/media/blink/watch_time_reporter_unittest.cc
+++ b/media/blink/watch_time_reporter_unittest.cc
@@ -246,9 +246,9 @@ TEST_F(WatchTimeReporterTest, WatchTimeReporter) {
wtr_->OnPlaying();
EXPECT_FALSE(IsMonitoring());
- Initialize(true, false, true, true, kSizeJustRight);
+ Initialize(true, false, true, true, gfx::Size());
wtr_->OnPlaying();
- EXPECT_FALSE(IsMonitoring());
+ EXPECT_TRUE(IsMonitoring());
constexpr gfx::Size kSizeTooSmall = gfx::Size(100, 100);
Initialize(true, true, true, true, kSizeTooSmall);
@@ -266,6 +266,18 @@ TEST_F(WatchTimeReporterTest, WatchTimeReporter) {
Initialize(true, true, true, false, kSizeJustRight);
wtr_->OnPlaying();
EXPECT_TRUE(IsMonitoring());
+
+ Initialize(true, false, true, true, gfx::Size());
+ wtr_->OnPlaying();
+ EXPECT_TRUE(IsMonitoring());
+
+ Initialize(true, false, false, false, gfx::Size());
+ wtr_->OnPlaying();
+ EXPECT_TRUE(IsMonitoring());
+
+ Initialize(true, false, true, false, gfx::Size());
+ wtr_->OnPlaying();
+ EXPECT_TRUE(IsMonitoring());
}
// Tests that basic reporting for the all category works.
@@ -290,6 +302,7 @@ TEST_F(WatchTimeReporterTest, WatchTimeReporterBasic) {
EXPECT_WATCH_TIME(MediaLog::kWatchTimeAudioVideoMse, kWatchTimeLate);
CycleReportingTimer();
}
+
// Tests that starting from a non-zero base works.
TEST_F(WatchTimeReporterTest, WatchTimeReporterNonZeroStart) {
constexpr base::TimeDelta kWatchTime1 = base::TimeDelta::FromSeconds(5);

Powered by Google App Engine
This is Rietveld 408576698