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

Unified Diff: cc/surfaces/compositor_frame_sink_support_unittest.cc

Issue 2789143002: [cc] Test that CFSSupport forwards BeginFrameAcks in CompositorFrames. (Closed)
Patch Set: fix use after move Created 3 years, 9 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
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 3ee8a996bedfe690e8b7dcab2a76da52f9f4b5cc..f5ec6d7b15731540a97bc957d1e753c8278b46a4 100644
--- a/cc/surfaces/compositor_frame_sink_support_unittest.cc
+++ b/cc/surfaces/compositor_frame_sink_support_unittest.cc
@@ -958,6 +958,8 @@ TEST_F(CompositorFrameSinkSupportTest,
}
TEST_F(CompositorFrameSinkSupportTest, PassesOnBeginFrameAcks) {
+ const SurfaceId display_id = MakeSurfaceId(kDisplayFrameSink, 1);
+
// Request BeginFrames.
display_support().SetNeedsBeginFrame(true);
@@ -972,8 +974,18 @@ TEST_F(CompositorFrameSinkSupportTest, PassesOnBeginFrameAcks) {
display_support().BeginFrameDidNotSwap(ack);
EXPECT_EQ(ack, begin_frame_source()->LastAckForObserver(&display_support()));
- // TODO(eseckler): Check that the support forwards the BeginFrameAck attached
+ // Issue another BeginFrame.
+ args = CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 2);
+ begin_frame_source()->TestOnBeginFrame(args);
+
+ // Check that the support forwards the BeginFrameAck attached
// to a CompositorFrame to the BeginFrameSource.
+ BeginFrameAck ack2(0, 2, 2, true);
+ CompositorFrame frame = MakeCompositorFrame();
+ frame.metadata.begin_frame_ack = ack2;
+ display_support().SubmitCompositorFrame(display_id.local_surface_id(),
+ std::move(frame));
+ EXPECT_EQ(ack2, begin_frame_source()->LastAckForObserver(&display_support()));
}
// Checks whether the resources are returned before we send an ack.

Powered by Google App Engine
This is Rietveld 408576698