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

Unified Diff: cc/surfaces/compositor_frame_sink_support_unittest.cc

Issue 2727553004: [cc] Forward BeginFrameAcks through DirectCFS and CFSSupport. (Closed)
Patch Set: 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 efa9b1b2725067c9f8b253645016c0d9a2c6968a..a947a02981bf4f87019afd67671aebbf4be78c06 100644
--- a/cc/surfaces/compositor_frame_sink_support_unittest.cc
+++ b/cc/surfaces/compositor_frame_sink_support_unittest.cc
@@ -153,10 +153,13 @@ class CompositorFrameSinkSupportTest : public testing::Test,
this, &surface_manager_, kChildFrameSink2, false /* is_root */,
true /* handles_frame_sink_id_invalidation */,
true /* needs_sync_points */));
+ surface_manager_.RegisterBeginFrameSource(begin_frame_source_.get(),
Fady Samuel 2017/03/01 19:49:07 I guess cc::Display normally does this? Could you
Eric Seckler 2017/03/02 09:41:59 Correct, normally done by the display. The other t
+ 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.
@@ -723,5 +726,20 @@ TEST_F(CompositorFrameSinkSupportTest, DropStaleReferencesAfterActivation) {
EXPECT_THAT(GetChildReferences(parent_id), UnorderedElementsAre(child_id2));
}
+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