| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/layers/layer.h" | 5 #include "cc/layers/layer.h" |
| 6 | 6 |
| 7 #include "cc/animation/keyframed_animation_curve.h" | 7 #include "cc/animation/keyframed_animation_curve.h" |
| 8 #include "cc/base/math_util.h" | 8 #include "cc/base/math_util.h" |
| 9 #include "cc/layers/layer_impl.h" | 9 #include "cc/layers/layer_impl.h" |
| 10 #include "cc/resources/layer_painter.h" | 10 #include "cc/resources/layer_painter.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 void Paint(SkCanvas* canvas, const gfx::Rect& content_rect) override {} | 57 void Paint(SkCanvas* canvas, const gfx::Rect& content_rect) override {} |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 class LayerTest : public testing::Test { | 60 class LayerTest : public testing::Test { |
| 61 public: | 61 public: |
| 62 LayerTest() | 62 LayerTest() |
| 63 : host_impl_(&proxy_, &shared_bitmap_manager_), | 63 : host_impl_(&proxy_, &shared_bitmap_manager_), |
| 64 fake_client_(FakeLayerTreeHostClient::DIRECT_3D) {} | 64 fake_client_(FakeLayerTreeHostClient::DIRECT_3D) {} |
| 65 | 65 |
| 66 protected: | 66 protected: |
| 67 virtual void SetUp() override { | 67 void SetUp() override { |
| 68 layer_tree_host_.reset(new StrictMock<MockLayerTreeHost>(&fake_client_)); | 68 layer_tree_host_.reset(new StrictMock<MockLayerTreeHost>(&fake_client_)); |
| 69 } | 69 } |
| 70 | 70 |
| 71 virtual void TearDown() override { | 71 void TearDown() override { |
| 72 Mock::VerifyAndClearExpectations(layer_tree_host_.get()); | 72 Mock::VerifyAndClearExpectations(layer_tree_host_.get()); |
| 73 EXPECT_CALL(*layer_tree_host_, SetNeedsFullTreeSync()).Times(AnyNumber()); | 73 EXPECT_CALL(*layer_tree_host_, SetNeedsFullTreeSync()).Times(AnyNumber()); |
| 74 parent_ = nullptr; | 74 parent_ = nullptr; |
| 75 child1_ = nullptr; | 75 child1_ = nullptr; |
| 76 child2_ = nullptr; | 76 child2_ = nullptr; |
| 77 child3_ = nullptr; | 77 child3_ = nullptr; |
| 78 grand_child1_ = nullptr; | 78 grand_child1_ = nullptr; |
| 79 grand_child2_ = nullptr; | 79 grand_child2_ = nullptr; |
| 80 grand_child3_ = nullptr; | 80 grand_child3_ = nullptr; |
| 81 | 81 |
| (...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1248 root_layer->AddChild(becomes_not_draws_content); | 1248 root_layer->AddChild(becomes_not_draws_content); |
| 1249 EXPECT_EQ(0, root_layer->NumDescendantsThatDrawContent()); | 1249 EXPECT_EQ(0, root_layer->NumDescendantsThatDrawContent()); |
| 1250 | 1250 |
| 1251 becomes_draws_content->SetIsDrawable(true); | 1251 becomes_draws_content->SetIsDrawable(true); |
| 1252 root_layer->AddChild(becomes_draws_content); | 1252 root_layer->AddChild(becomes_draws_content); |
| 1253 EXPECT_EQ(1, root_layer->NumDescendantsThatDrawContent()); | 1253 EXPECT_EQ(1, root_layer->NumDescendantsThatDrawContent()); |
| 1254 } | 1254 } |
| 1255 | 1255 |
| 1256 } // namespace | 1256 } // namespace |
| 1257 } // namespace cc | 1257 } // namespace cc |
| OLD | NEW |