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

Unified Diff: cc/trees/layer_tree_impl_unittest.cc

Issue 375093002: Initial attempt at counting layers in the compositor thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comment in histograms.xml to say the stat is collected once per frame, before the frame is d… Created 6 years, 5 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/trees/layer_tree_impl.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_impl_unittest.cc
diff --git a/cc/trees/layer_tree_impl_unittest.cc b/cc/trees/layer_tree_impl_unittest.cc
index 9edf838bb60c3379ffe76fc01943a19ac3dc5e22..d2153491d68905ba34cce873167013fe38af353d 100644
--- a/cc/trees/layer_tree_impl_unittest.cc
+++ b/cc/trees/layer_tree_impl_unittest.cc
@@ -2319,5 +2319,20 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForScaledLayers) {
EXPECT_TRUE(right_output.visible);
}
+TEST_F(LayerTreeImplTest, NumLayersTestOne) {
+ EXPECT_EQ(0u, host_impl().active_tree()->NumLayers());
+ scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1);
+ EXPECT_EQ(1u, host_impl().active_tree()->NumLayers());
+}
+
+TEST_F(LayerTreeImplTest, NumLayersSmallTree) {
+ EXPECT_EQ(0u, host_impl().active_tree()->NumLayers());
+ scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1);
+ root->AddChild(LayerImpl::Create(host_impl().active_tree(), 2));
+ root->AddChild(LayerImpl::Create(host_impl().active_tree(), 3));
+ root->child_at(1)->AddChild(LayerImpl::Create(host_impl().active_tree(), 4));
+ EXPECT_EQ(4u, host_impl().active_tree()->NumLayers());
+}
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/trees/layer_tree_impl.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698