| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/thread_task_runner_handle.h" | 9 #include "base/thread_task_runner_handle.h" |
| 10 #include "cc/animation/animation_host.h" | 10 #include "cc/animation/animation_host.h" |
| (...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1131 scoped_refptr<Layer> child = Layer::Create(); | 1131 scoped_refptr<Layer> child = Layer::Create(); |
| 1132 | 1132 |
| 1133 // Upon creation, layers should not have children or parent. | 1133 // Upon creation, layers should not have children or parent. |
| 1134 ASSERT_EQ(0U, parent->children().size()); | 1134 ASSERT_EQ(0U, parent->children().size()); |
| 1135 EXPECT_FALSE(child->parent()); | 1135 EXPECT_FALSE(child->parent()); |
| 1136 | 1136 |
| 1137 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, layer_tree_host_->SetRootLayer(parent)); | 1137 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, layer_tree_host_->SetRootLayer(parent)); |
| 1138 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, parent->AddChild(child)); | 1138 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, parent->AddChild(child)); |
| 1139 | 1139 |
| 1140 ASSERT_EQ(1U, parent->children().size()); | 1140 ASSERT_EQ(1U, parent->children().size()); |
| 1141 EXPECT_EQ(child.get(), parent->children()[0].get()); | 1141 EXPECT_EQ(child.get(), parent->children()[0]); |
| 1142 EXPECT_EQ(parent.get(), child->parent()); | 1142 EXPECT_EQ(parent.get(), child->parent()); |
| 1143 EXPECT_EQ(parent.get(), child->RootLayer()); | 1143 EXPECT_EQ(parent.get(), child->RootLayer()); |
| 1144 | 1144 |
| 1145 EXPECT_SET_NEEDS_FULL_TREE_SYNC(AtLeast(1), child->RemoveFromParent()); | 1145 EXPECT_SET_NEEDS_FULL_TREE_SYNC(AtLeast(1), child->RemoveFromParent()); |
| 1146 } | 1146 } |
| 1147 | 1147 |
| 1148 TEST_F(LayerTest, AddSameChildTwice) { | 1148 TEST_F(LayerTest, AddSameChildTwice) { |
| 1149 EXPECT_CALL(*layer_tree_host_, SetNeedsFullTreeSync()).Times(AtLeast(1)); | 1149 EXPECT_CALL(*layer_tree_host_, SetNeedsFullTreeSync()).Times(AtLeast(1)); |
| 1150 | 1150 |
| 1151 scoped_refptr<Layer> parent = Layer::Create(); | 1151 scoped_refptr<Layer> parent = Layer::Create(); |
| (...skipping 1334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2486 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties()); | 2486 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties()); |
| 2487 | 2487 |
| 2488 test_layer->PushPropertiesTo(impl_layer.get()); | 2488 test_layer->PushPropertiesTo(impl_layer.get()); |
| 2489 | 2489 |
| 2490 EXPECT_EQ(2lu, impl_layer->element_id()); | 2490 EXPECT_EQ(2lu, impl_layer->element_id()); |
| 2491 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties()); | 2491 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties()); |
| 2492 } | 2492 } |
| 2493 | 2493 |
| 2494 } // namespace | 2494 } // namespace |
| 2495 } // namespace cc | 2495 } // namespace cc |
| OLD | NEW |