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

Unified Diff: cc/surfaces/display_scheduler_unittest.cc

Issue 1155183004: cc: Properly detect when child Surfaces idle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « cc/surfaces/display_scheduler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/display_scheduler_unittest.cc
diff --git a/cc/surfaces/display_scheduler_unittest.cc b/cc/surfaces/display_scheduler_unittest.cc
index ab526f8fee569d8d428646197e131b5a587aae93..7fedbc77c64519b0d5146f9b41ce1206b0fda0a2 100644
--- a/cc/surfaces/display_scheduler_unittest.cc
+++ b/cc/surfaces/display_scheduler_unittest.cc
@@ -116,9 +116,13 @@ TEST_F(DisplaySchedulerTest, EntireDisplayDamagedDrawsImmediately) {
}
TEST_F(DisplaySchedulerTest, SurfaceDamaged) {
+ SurfaceId root_surface_id(0);
SurfaceId sid1(1);
SurfaceId sid2(2);
+ // Set the root surface
+ scheduler_->EntireDisplayDamaged(root_surface_id);
+
// Get scheduler to detect surface 1 as active by drawing
// two frames in a row with damage from surface 1.
BeginFrameForTest();
@@ -157,6 +161,22 @@ TEST_F(DisplaySchedulerTest, SurfaceDamaged) {
EXPECT_GE(now_src().Now(),
scheduler_->DesiredBeginFrameDeadlineTimeForTest());
scheduler_->BeginFrameDeadlineForTest();
+
+ // Make the system idle
+ BeginFrameForTest();
+ scheduler_->BeginFrameDeadlineForTest();
+ BeginFrameForTest();
+ scheduler_->BeginFrameDeadlineForTest();
+
+ // Deadline should trigger early if child surfaces are idle and
+ // we get damage on the root surface.
+ BeginFrameForTest();
+ EXPECT_LT(now_src().Now(),
+ scheduler_->DesiredBeginFrameDeadlineTimeForTest());
+ scheduler_->SurfaceDamaged(root_surface_id);
+ EXPECT_GE(now_src().Now(),
+ scheduler_->DesiredBeginFrameDeadlineTimeForTest());
+ scheduler_->BeginFrameDeadlineForTest();
}
TEST_F(DisplaySchedulerTest, OutputSurfaceLost) {
« no previous file with comments | « cc/surfaces/display_scheduler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698