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

Unified Diff: cc/surfaces/compositor_frame_sink_support_unittest.cc

Issue 2727553004: [cc] Forward BeginFrameAcks through DirectCFS and CFSSupport. (Closed)
Patch Set: rebase Created 3 years, 10 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/compositor_frame_sink_support.cc ('k') | cc/surfaces/direct_compositor_frame_sink.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 ed7bea2979ff827c3108111a84017db6ee89810e..83cf8edce9c5efd62c44d30f5a34cac2620b35e0 100644
--- a/cc/surfaces/compositor_frame_sink_support_unittest.cc
+++ b/cc/surfaces/compositor_frame_sink_support_unittest.cc
@@ -153,10 +153,18 @@ class CompositorFrameSinkSupportTest : public testing::Test,
this, &surface_manager_, kChildFrameSink2, false /* is_root */,
true /* handles_frame_sink_id_invalidation */,
true /* needs_sync_points */));
+
+ // Normally, the BeginFrameSource would be registered by the Display. We
+ // register it here so that BeginFrames are received by the display support,
+ // for use in the PassesOnBeginFrameAcks test. Other supports do not receive
+ // BeginFrames, since the frame sink hierarchy is not set up in this test.
+ surface_manager_.RegisterBeginFrameSource(begin_frame_source_.get(),
+ kDisplayFrameSink);
}
void TearDown() override {
surface_manager_.SetDependencyTracker(nullptr);
+ surface_manager_.UnregisterBeginFrameSource(begin_frame_source_.get());
// SurfaceDependencyTracker depends on this BeginFrameSource and so it must
// be destroyed AFTER the dependency tracker is destroyed.
@@ -924,5 +932,20 @@ TEST_F(CompositorFrameSinkSupportTest,
EXPECT_EQ(latency_sequence_number1, comp1.sequence_number);
}
+TEST_F(CompositorFrameSinkSupportTest, PassesOnBeginFrameAcks) {
+ // Request BeginFrames.
+ display_support().SetNeedsBeginFrame(true);
+
+ // Issue a BeginFrame.
+ BeginFrameArgs args =
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 1);
+ begin_frame_source()->TestOnBeginFrame(args);
+
+ // Check that the support forwards our ack to the BeginFrameSource.
+ BeginFrameAck ack(0, 1, 1, 0, false);
+ display_support().DidFinishFrame(ack);
+ EXPECT_EQ(ack, begin_frame_source()->LastAckForObserver(&display_support()));
+}
+
} // namespace test
} // namespace cc
« no previous file with comments | « cc/surfaces/compositor_frame_sink_support.cc ('k') | cc/surfaces/direct_compositor_frame_sink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698