Chromium Code Reviews| 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..ce44a7cc430a68e3527c89e9c393ee8c1d8671c5 100644 |
| --- a/cc/trees/layer_tree_impl_unittest.cc |
| +++ b/cc/trees/layer_tree_impl_unittest.cc |
| @@ -2319,5 +2319,24 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForScaledLayers) { |
| EXPECT_TRUE(right_output.visible); |
| } |
| +TEST_F(LayerTreeImplTest, NumLayersTestZero) { |
| + CHECK_EQ(0u, host_impl().active_tree()->NumLayers()); |
| +} |
| + |
| +TEST_F(LayerTreeImplTest, NumLayersTestOne) { |
| + scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1); |
| + host_impl().active_tree()->SetRootLayer(root.Pass()); |
|
danakj
2014/07/10 21:27:44
how about just EXPECT 0 before setting the root la
dneto
2014/07/11 15:23:31
Acknowledged.
|
| + CHECK_EQ(1u, host_impl().active_tree()->NumLayers()); |
|
danakj
2014/07/10 21:27:44
EXPECT_EQ not CHECK_EQ in a test
dneto
2014/07/11 15:23:31
Ouch! Thanks.
|
| +} |
| + |
| +TEST_F(LayerTreeImplTest, NumLayersSmallTree) { |
| + 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)); |
| + host_impl().active_tree()->SetRootLayer(root.Pass()); |
|
danakj
2014/07/10 21:27:44
can you EXPECT 0 before doing the set root so we c
dneto
2014/07/11 15:23:31
Acknowledged.
|
| + EXPECT_EQ(4u, host_impl().active_tree()->NumLayers()); |
| +} |
| + |
| } // namespace |
| } // namespace cc |