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

Side by Side Diff: cc/layers/layer_unittest.cc

Issue 1801853002: Transfer LayerImpl ownership to LayerTreeImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaaase. Created 4 years, 9 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 unified diff | Download patch
OLDNEW
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 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 scoped_refptr<Layer> child = Layer::Create(); 1123 scoped_refptr<Layer> child = Layer::Create();
1124 1124
1125 // Upon creation, layers should not have children or parent. 1125 // Upon creation, layers should not have children or parent.
1126 ASSERT_EQ(0U, parent->children().size()); 1126 ASSERT_EQ(0U, parent->children().size());
1127 EXPECT_FALSE(child->parent()); 1127 EXPECT_FALSE(child->parent());
1128 1128
1129 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, layer_tree_host_->SetRootLayer(parent)); 1129 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, layer_tree_host_->SetRootLayer(parent));
1130 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, parent->AddChild(child)); 1130 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, parent->AddChild(child));
1131 1131
1132 ASSERT_EQ(1U, parent->children().size()); 1132 ASSERT_EQ(1U, parent->children().size());
1133 EXPECT_EQ(child.get(), parent->children()[0].get()); 1133 EXPECT_EQ(child.get(), parent->children()[0]);
1134 EXPECT_EQ(parent.get(), child->parent()); 1134 EXPECT_EQ(parent.get(), child->parent());
1135 EXPECT_EQ(parent.get(), child->RootLayer()); 1135 EXPECT_EQ(parent.get(), child->RootLayer());
1136 1136
1137 EXPECT_SET_NEEDS_FULL_TREE_SYNC(AtLeast(1), child->RemoveFromParent()); 1137 EXPECT_SET_NEEDS_FULL_TREE_SYNC(AtLeast(1), child->RemoveFromParent());
1138 } 1138 }
1139 1139
1140 TEST_F(LayerTest, AddSameChildTwice) { 1140 TEST_F(LayerTest, AddSameChildTwice) {
1141 EXPECT_CALL(*layer_tree_host_, SetNeedsFullTreeSync()).Times(AtLeast(1)); 1141 EXPECT_CALL(*layer_tree_host_, SetNeedsFullTreeSync()).Times(AtLeast(1));
1142 1142
1143 scoped_refptr<Layer> parent = Layer::Create(); 1143 scoped_refptr<Layer> parent = Layer::Create();
(...skipping 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after
2628 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties()); 2628 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties());
2629 2629
2630 test_layer->PushPropertiesTo(impl_layer.get()); 2630 test_layer->PushPropertiesTo(impl_layer.get());
2631 2631
2632 EXPECT_EQ(2lu, impl_layer->element_id()); 2632 EXPECT_EQ(2lu, impl_layer->element_id());
2633 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties()); 2633 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties());
2634 } 2634 }
2635 2635
2636 } // namespace 2636 } // namespace
2637 } // namespace cc 2637 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698