summaryrefslogtreecommitdiffstats
path: root/cc/trees/layer_tree_impl_unittest.cc
diff options
context:
space:
mode:
authordneto@chromium.org <dneto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-14 16:57:59 +0000
committerdneto@chromium.org <dneto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-14 16:57:59 +0000
commitaebf4624ae95abebd8983aaf6f3b5c82c57946d2 (patch)
tree280ef6c2c36c0fee408912d06fe5c70f59945476 /cc/trees/layer_tree_impl_unittest.cc
parent43d33e91527fc4320e5d555fd947910dbd95b9ad (diff)
downloadchromium_src-aebf4624ae95abebd8983aaf6f3b5c82c57946d2.zip
chromium_src-aebf4624ae95abebd8983aaf6f3b5c82c57946d2.tar.gz
chromium_src-aebf4624ae95abebd8983aaf6f3b5c82c57946d2.tar.bz2
Add a UMA for the number of layers in a frame.
Reported from the compositor thread. BUG=253919 Review URL: https://codereview.chromium.org/375093002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282964 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/trees/layer_tree_impl_unittest.cc')
-rw-r--r--cc/trees/layer_tree_impl_unittest.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/cc/trees/layer_tree_impl_unittest.cc b/cc/trees/layer_tree_impl_unittest.cc
index 9edf838..d215349 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