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

Unified Diff: cc/surfaces/compositor_frame_sink_support_unittest.cc

Issue 2814633006: Surface synchronization: Immediately activate late arriving CompositorFrames (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | cc/surfaces/surface_dependency_tracker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/compositor_frame_sink_support_unittest.cc
diff --git a/cc/surfaces/compositor_frame_sink_support_unittest.cc b/cc/surfaces/compositor_frame_sink_support_unittest.cc
index c9ed4bf8498d9e1b0f6e72366a8d27a739bb1f25..9baf995a4207ce4dc651ed7f2a392e2a9c1e0746 100644
--- a/cc/surfaces/compositor_frame_sink_support_unittest.cc
+++ b/cc/surfaces/compositor_frame_sink_support_unittest.cc
@@ -1210,5 +1210,41 @@ TEST_F(CompositorFrameSinkSupportTest, OnlyBlockOnEmbeddedSurfaces) {
EXPECT_THAT(GetChildReferences(display_id), UnorderedElementsAre(parent_id1));
}
+// This test verifies that a late arriving CompositorFrame activates immediately
+// and does not trigger a new deadline.
+TEST_F(CompositorFrameSinkSupportTest, LateArrivingDependency) {
+ const SurfaceId display_id = MakeSurfaceId(kDisplayFrameSink, 1);
+ const SurfaceId parent_id1 = MakeSurfaceId(kParentFrameSink, 1);
+ const SurfaceId child_id1 = MakeSurfaceId(kChildFrameSink1, 1);
+
+ display_support().SubmitCompositorFrame(display_id.local_surface_id(),
+ MakeCompositorFrame({parent_id1}));
+
+ EXPECT_TRUE(display_surface()->HasPendingFrame());
+ EXPECT_FALSE(display_surface()->HasActiveFrame());
+ EXPECT_TRUE(dependency_tracker().has_deadline());
+
+ // Advance BeginFrames to trigger a deadline. This activates the
+ // CompositorFrame submitted above.
+ BeginFrameArgs args =
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 1);
+ for (int i = 0; i < 3; ++i) {
+ begin_frame_source()->TestOnBeginFrame(args);
+ EXPECT_TRUE(dependency_tracker().has_deadline());
+ }
+ begin_frame_source()->TestOnBeginFrame(args);
+ EXPECT_FALSE(dependency_tracker().has_deadline());
+ EXPECT_FALSE(display_surface()->HasPendingFrame());
+ EXPECT_TRUE(display_surface()->HasActiveFrame());
+
+ // A late arriving CompositorFrame should activate immediately without
+ // scheduling a deadline and without waiting for dependencies to resolve.
+ parent_support().SubmitCompositorFrame(parent_id1.local_surface_id(),
+ MakeCompositorFrame({child_id1}));
+ EXPECT_FALSE(dependency_tracker().has_deadline());
+ EXPECT_FALSE(parent_surface()->HasPendingFrame());
+ EXPECT_TRUE(parent_surface()->HasActiveFrame());
+}
+
} // namespace test
} // namespace cc
« no previous file with comments | « no previous file | cc/surfaces/surface_dependency_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698