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

Side by Side Diff: cc/trees/tree_synchronizer_unittest.cc

Issue 12519006: cc:: Add RenderingStatsInstrumentation to manage collection of RenderingStats (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase to LayerTreeTest Created 7 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/trees/tree_synchronizer.h" 5 #include "cc/trees/tree_synchronizer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "cc/animation/layer_animation_controller.h" 9 #include "cc/animation/layer_animation_controller.h"
10 #include "cc/layers/layer.h" 10 #include "cc/layers/layer.h"
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 host_impl_.active_tree()); 477 host_impl_.active_tree());
478 ExpectTreesAreIdentical(layer_tree_root.get(), 478 ExpectTreesAreIdentical(layer_tree_root.get(),
479 layer_impl_tree_root.get(), 479 layer_impl_tree_root.get(),
480 host_impl_.active_tree()); 480 host_impl_.active_tree());
481 } 481 }
482 482
483 TEST_F(TreeSynchronizerTest, SynchronizeAnimations) { 483 TEST_F(TreeSynchronizerTest, SynchronizeAnimations) {
484 LayerTreeSettings settings; 484 LayerTreeSettings settings;
485 FakeProxy proxy(scoped_ptr<Thread>(NULL)); 485 FakeProxy proxy(scoped_ptr<Thread>(NULL));
486 DebugScopedSetImplThread impl(&proxy); 486 DebugScopedSetImplThread impl(&proxy);
487 scoped_ptr<RenderingStatsInstrumentation> stats_instrumentation =
488 RenderingStatsInstrumentation::Create();
487 scoped_ptr<LayerTreeHostImpl> host_impl = 489 scoped_ptr<LayerTreeHostImpl> host_impl =
488 LayerTreeHostImpl::Create(settings, NULL, &proxy); 490 LayerTreeHostImpl::Create(settings,
491 NULL,
492 &proxy,
493 stats_instrumentation.get());
489 494
490 scoped_refptr<Layer> layer_tree_root = Layer::Create(); 495 scoped_refptr<Layer> layer_tree_root = Layer::Create();
491 496
492 layer_tree_root->SetLayerAnimationController( 497 layer_tree_root->SetLayerAnimationController(
493 FakeLayerAnimationController::Create()); 498 FakeLayerAnimationController::Create());
494 499
495 EXPECT_FALSE(static_cast<FakeLayerAnimationController*>( 500 EXPECT_FALSE(static_cast<FakeLayerAnimationController*>(
496 layer_tree_root->layer_animation_controller())->SynchronizedAnimations()); 501 layer_tree_root->layer_animation_controller())->SynchronizedAnimations());
497 502
498 scoped_ptr<LayerImpl> layer_impl_tree_root = 503 scoped_ptr<LayerImpl> layer_impl_tree_root =
499 TreeSynchronizer::SynchronizeTrees(layer_tree_root.get(), 504 TreeSynchronizer::SynchronizeTrees(layer_tree_root.get(),
500 scoped_ptr<LayerImpl>(), 505 scoped_ptr<LayerImpl>(),
501 host_impl_.active_tree()); 506 host_impl_.active_tree());
502 TreeSynchronizer::PushProperties(layer_tree_root.get(), 507 TreeSynchronizer::PushProperties(layer_tree_root.get(),
503 layer_impl_tree_root.get()); 508 layer_impl_tree_root.get());
504 layer_impl_tree_root = 509 layer_impl_tree_root =
505 TreeSynchronizer::SynchronizeTrees(layer_tree_root.get(), 510 TreeSynchronizer::SynchronizeTrees(layer_tree_root.get(),
506 layer_impl_tree_root.Pass(), 511 layer_impl_tree_root.Pass(),
507 host_impl_.active_tree()); 512 host_impl_.active_tree());
508 513
509 EXPECT_TRUE(static_cast<FakeLayerAnimationController*>( 514 EXPECT_TRUE(static_cast<FakeLayerAnimationController*>(
510 layer_tree_root->layer_animation_controller())->SynchronizedAnimations()); 515 layer_tree_root->layer_animation_controller())->SynchronizedAnimations());
511 } 516 }
512 517
513 } // namespace 518 } // namespace
514 } // namespace cc 519 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698