Index: cc/tree_synchronizer_unittest.cc |
=================================================================== |
--- cc/tree_synchronizer_unittest.cc (revision 165906) |
+++ cc/tree_synchronizer_unittest.cc (working copy) |
@@ -13,7 +13,6 @@ |
#include "cc/proxy.h" |
#include "cc/single_thread_proxy.h" |
#include "cc/test/animation_test_common.h" |
-#include "cc/test/fake_proxy.h" |
#include "testing/gtest/include/gtest/gtest.h" |
using namespace cc; |
@@ -132,6 +131,8 @@ |
// return a null tree. |
TEST(TreeSynchronizerTest, syncNullTree) |
{ |
+ DebugScopedSetImplThread impl; |
+ |
scoped_ptr<LayerImpl> layerImplTreeRoot = TreeSynchronizer::synchronizeTrees(0, scoped_ptr<LayerImpl>(), 0); |
EXPECT_TRUE(!layerImplTreeRoot.get()); |
@@ -140,10 +141,10 @@ |
// Constructs a very simple tree and synchronizes it without trying to reuse any preexisting layers. |
TEST(TreeSynchronizerTest, syncSimpleTreeFromEmpty) |
{ |
+ DebugScopedSetImplThread impl; |
+ |
LayerTreeSettings settings; |
- FakeProxy proxy(scoped_ptr<Thread>(NULL)); |
- DebugScopedSetImplThread impl(&proxy); |
- scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0, &proxy); |
+ scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0); |
scoped_refptr<Layer> layerTreeRoot = Layer::create(); |
layerTreeRoot->addChild(Layer::create()); |
@@ -157,12 +158,11 @@ |
// Constructs a very simple tree and synchronizes it attempting to reuse some layers |
TEST(TreeSynchronizerTest, syncSimpleTreeReusingLayers) |
{ |
+ DebugScopedSetImplThread impl; |
std::vector<int> layerImplDestructionList; |
LayerTreeSettings settings; |
- FakeProxy proxy(scoped_ptr<Thread>(NULL)); |
- DebugScopedSetImplThread impl(&proxy); |
- scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0, &proxy); |
+ scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0); |
scoped_refptr<Layer> layerTreeRoot = MockLayer::create(&layerImplDestructionList); |
layerTreeRoot->addChild(MockLayer::create(&layerImplDestructionList)); |
@@ -188,12 +188,11 @@ |
// Constructs a very simple tree and checks that a stacking-order change is tracked properly. |
TEST(TreeSynchronizerTest, syncSimpleTreeAndTrackStackingOrderChange) |
{ |
+ DebugScopedSetImplThread impl; |
std::vector<int> layerImplDestructionList; |
LayerTreeSettings settings; |
- FakeProxy proxy(scoped_ptr<Thread>(NULL)); |
- DebugScopedSetImplThread impl(&proxy); |
- scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0, &proxy); |
+ scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0); |
// Set up the tree and sync once. child2 needs to be synced here, too, even though we |
// remove it to set up the intended scenario. |
@@ -219,10 +218,10 @@ |
TEST(TreeSynchronizerTest, syncSimpleTreeAndProperties) |
{ |
+ DebugScopedSetImplThread impl; |
+ |
LayerTreeSettings settings; |
- FakeProxy proxy(scoped_ptr<Thread>(NULL)); |
- DebugScopedSetImplThread impl(&proxy); |
- scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0, &proxy); |
+ scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0); |
scoped_refptr<Layer> layerTreeRoot = Layer::create(); |
layerTreeRoot->addChild(Layer::create()); |
@@ -255,12 +254,11 @@ |
TEST(TreeSynchronizerTest, reuseLayerImplsAfterStructuralChange) |
{ |
+ DebugScopedSetImplThread impl; |
std::vector<int> layerImplDestructionList; |
LayerTreeSettings settings; |
- FakeProxy proxy(scoped_ptr<Thread>(NULL)); |
- DebugScopedSetImplThread impl(&proxy); |
- scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0, &proxy); |
+ scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0); |
// Set up a tree with this sort of structure: |
// root --- A --- B ---+--- C |
@@ -306,12 +304,11 @@ |
// Constructs a very simple tree, synchronizes it, then synchronizes to a totally new tree. All layers from the old tree should be deleted. |
TEST(TreeSynchronizerTest, syncSimpleTreeThenDestroy) |
{ |
+ DebugScopedSetImplThread impl; |
std::vector<int> layerImplDestructionList; |
LayerTreeSettings settings; |
- FakeProxy proxy(scoped_ptr<Thread>(NULL)); |
- DebugScopedSetImplThread impl(&proxy); |
- scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0, &proxy); |
+ scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0); |
scoped_refptr<Layer> oldLayerTreeRoot = MockLayer::create(&layerImplDestructionList); |
oldLayerTreeRoot->addChild(MockLayer::create(&layerImplDestructionList)); |
@@ -342,10 +339,10 @@ |
// Constructs+syncs a tree with mask, replica, and replica mask layers. |
TEST(TreeSynchronizerTest, syncMaskReplicaAndReplicaMaskLayers) |
{ |
+ DebugScopedSetImplThread impl; |
+ |
LayerTreeSettings settings; |
- FakeProxy proxy(scoped_ptr<Thread>(NULL)); |
- DebugScopedSetImplThread impl(&proxy); |
- scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0, &proxy); |
+ scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0); |
scoped_refptr<Layer> layerTreeRoot = Layer::create(); |
layerTreeRoot->addChild(Layer::create()); |
@@ -388,10 +385,10 @@ |
TEST(TreeSynchronizerTest, synchronizeAnimations) |
{ |
+ DebugScopedSetImplThread impl; |
+ |
LayerTreeSettings settings; |
- FakeProxy proxy(scoped_ptr<Thread>(NULL)); |
- DebugScopedSetImplThread impl(&proxy); |
- scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0, &proxy); |
+ scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0); |
scoped_refptr<Layer> layerTreeRoot = Layer::create(); |