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

Unified Diff: trunk/src/cc/trees/layer_tree_host_impl_unittest.cc

Issue 96363002: Revert 237857 "Revert 237848 "Use LatencyInfoSwapPromise to trac..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 1 month 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 | « trunk/src/cc/trees/layer_tree_host_impl.cc ('k') | trunk/src/cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/cc/trees/layer_tree_host_impl_unittest.cc
===================================================================
--- trunk/src/cc/trees/layer_tree_host_impl_unittest.cc (revision 237886)
+++ trunk/src/cc/trees/layer_tree_host_impl_unittest.cc (working copy)
@@ -5335,5 +5335,44 @@
}
}
+// Make sure LatencyInfo carried by LatencyInfoSwapPromise are passed
+// to CompositorFrameMetadata after SwapBuffers();
+TEST_F(LayerTreeHostImplTest, LatencyInfoPassedToCompositorFrameMetadata) {
+ scoped_ptr<SolidColorLayerImpl> root =
+ SolidColorLayerImpl::Create(host_impl_->active_tree(), 1);
+ root->SetAnchorPoint(gfx::PointF());
+ root->SetPosition(gfx::PointF());
+ root->SetBounds(gfx::Size(10, 10));
+ root->SetContentBounds(gfx::Size(10, 10));
+ root->SetDrawsContent(true);
+
+ host_impl_->active_tree()->SetRootLayer(root.PassAs<LayerImpl>());
+
+ FakeOutputSurface* fake_output_surface =
+ static_cast<FakeOutputSurface*>(host_impl_->output_surface());
+
+ const ui::LatencyInfo& metadata_latency_before =
+ fake_output_surface->last_sent_frame().metadata.latency_info;
+ EXPECT_FALSE(metadata_latency_before.FindLatency(
+ ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, 0, NULL));
+
+ ui::LatencyInfo latency_info;
+ latency_info.AddLatencyNumber(
+ ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, 0, 0);
+ host_impl_->SetLatencyInfoForInputEvent(latency_info);
+
+ gfx::Rect full_frame_damage(host_impl_->DrawViewportSize());
+ LayerTreeHostImpl::FrameData frame;
+ EXPECT_TRUE(host_impl_->PrepareToDraw(&frame, gfx::Rect()));
+ host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
+ host_impl_->DidDrawAllLayers(frame);
+ EXPECT_TRUE(host_impl_->SwapBuffers(frame));
+
+ const ui::LatencyInfo& metadata_latency_after =
+ fake_output_surface->last_sent_frame().metadata.latency_info;
+ EXPECT_TRUE(metadata_latency_after.FindLatency(
+ ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, 0, NULL));
+}
+
} // namespace
} // namespace cc
« no previous file with comments | « trunk/src/cc/trees/layer_tree_host_impl.cc ('k') | trunk/src/cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698