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

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

Issue 13285002: cc: Consolidate LayerList types. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « cc/layers/layer_lists.h ('k') | cc/layers/render_surface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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/base/thread.h" 9 #include "cc/base/thread.h"
10 #include "cc/layers/layer_impl.h" 10 #include "cc/layers/layer_impl.h"
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 EXPECT_FALSE(child3_->parent()); 385 EXPECT_FALSE(child3_->parent());
386 } 386 }
387 387
388 TEST_F(LayerTest, SetChildren) { 388 TEST_F(LayerTest, SetChildren) {
389 scoped_refptr<Layer> old_parent = Layer::Create(); 389 scoped_refptr<Layer> old_parent = Layer::Create();
390 scoped_refptr<Layer> new_parent = Layer::Create(); 390 scoped_refptr<Layer> new_parent = Layer::Create();
391 391
392 scoped_refptr<Layer> child1 = Layer::Create(); 392 scoped_refptr<Layer> child1 = Layer::Create();
393 scoped_refptr<Layer> child2 = Layer::Create(); 393 scoped_refptr<Layer> child2 = Layer::Create();
394 394
395 std::vector<scoped_refptr<Layer> > new_children; 395 LayerList new_children;
396 new_children.push_back(child1); 396 new_children.push_back(child1);
397 new_children.push_back(child2); 397 new_children.push_back(child2);
398 398
399 // Set up and verify initial test conditions: child1 has a parent, child2 has 399 // Set up and verify initial test conditions: child1 has a parent, child2 has
400 // no parent. 400 // no parent.
401 old_parent->AddChild(child1); 401 old_parent->AddChild(child1);
402 ASSERT_EQ(0U, new_parent->children().size()); 402 ASSERT_EQ(0U, new_parent->children().size());
403 EXPECT_EQ(old_parent.get(), child1->parent()); 403 EXPECT_EQ(old_parent.get(), child1->parent());
404 EXPECT_FALSE(child2->parent()); 404 EXPECT_FALSE(child2->parent());
405 405
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 layer->SetLayerTreeHost(layer_tree_host.get()); 1002 layer->SetLayerTreeHost(layer_tree_host.get());
1003 AssertLayerTreeHostMatchesForSubtree(layer.get(), layer_tree_host.get()); 1003 AssertLayerTreeHostMatchesForSubtree(layer.get(), layer_tree_host.get());
1004 1004
1005 // Case 3: with a LayerTreeHost where accelerated animation is disabled, the 1005 // Case 3: with a LayerTreeHost where accelerated animation is disabled, the
1006 // animation should be rejected. 1006 // animation should be rejected.
1007 EXPECT_FALSE(AddTestAnimation(layer.get())); 1007 EXPECT_FALSE(AddTestAnimation(layer.get()));
1008 } 1008 }
1009 1009
1010 } // namespace 1010 } // namespace
1011 } // namespace cc 1011 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_lists.h ('k') | cc/layers/render_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698