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

Unified Diff: media/base/wall_clock_time_source_unittest.cc

Issue 2322393002: Clear reference time after SetMediaTime in video-only time source. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/wall_clock_time_source.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/wall_clock_time_source_unittest.cc
diff --git a/media/base/wall_clock_time_source_unittest.cc b/media/base/wall_clock_time_source_unittest.cc
index 6f8fa3af28fd1ec093629a118d5b2e51834f1e9f..cf67ac59b9008fede8073c204f7dd5c59ffb125c 100644
--- a/media/base/wall_clock_time_source_unittest.cc
+++ b/media/base/wall_clock_time_source_unittest.cc
@@ -89,6 +89,10 @@ TEST_F(WallClockTimeSourceTest, SetMediaTime) {
SetMediaTimeInSeconds(10);
EXPECT_EQ(10, CurrentMediaTimeInSeconds());
EXPECT_TRUE(IsTimeStopped());
+ std::vector<base::TimeTicks> wall_clock_times;
+ time_source_.GetWallClockTimes(std::vector<base::TimeDelta>(),
+ &wall_clock_times);
+ EXPECT_EQ(base::TimeTicks(), wall_clock_times[0]);
}
TEST_F(WallClockTimeSourceTest, SetPlaybackRate) {
@@ -163,6 +167,14 @@ TEST_F(WallClockTimeSourceTest, EmptyMediaTimestampsReturnMediaWallClockTime) {
std::vector<base::TimeDelta>(), &wall_clock_times);
EXPECT_FALSE(is_time_moving);
EXPECT_EQ(tick_clock_->NowTicks(), wall_clock_times[0]);
+
+ // Setting media time should clear reference time.
+ SetMediaTimeInSeconds(5);
+ wall_clock_times.clear();
+ is_time_moving = time_source_.GetWallClockTimes(
+ std::vector<base::TimeDelta>(), &wall_clock_times);
+ EXPECT_FALSE(is_time_moving);
+ EXPECT_EQ(base::TimeTicks(), wall_clock_times[0]);
}
} // namespace media
« no previous file with comments | « media/base/wall_clock_time_source.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698