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

Unified Diff: cc/tree_synchronizer_unittest.cc

Issue 11232051: Remove static thread pointers from CC (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Apply code review comments Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/tiled_layer_unittest.cc ('k') | cc/video_layer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tree_synchronizer_unittest.cc
diff --git a/cc/tree_synchronizer_unittest.cc b/cc/tree_synchronizer_unittest.cc
index 7741967b0759b5ec5cbc3c83098d994a613fa858..350190358c9da8b10436e2c77aeafbdd5c73c1c0 100644
--- a/cc/tree_synchronizer_unittest.cc
+++ b/cc/tree_synchronizer_unittest.cc
@@ -13,6 +13,7 @@
#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;
@@ -131,8 +132,6 @@ void expectTreesAreIdentical(Layer* layer, LayerImpl* layerImpl, LayerTreeHostIm
// return a null tree.
TEST(TreeSynchronizerTest, syncNullTree)
{
- DebugScopedSetImplThread impl;
-
scoped_ptr<LayerImpl> layerImplTreeRoot = TreeSynchronizer::synchronizeTrees(0, scoped_ptr<LayerImpl>(), 0);
EXPECT_TRUE(!layerImplTreeRoot.get());
@@ -141,10 +140,10 @@ TEST(TreeSynchronizerTest, syncNullTree)
// Constructs a very simple tree and synchronizes it without trying to reuse any preexisting layers.
TEST(TreeSynchronizerTest, syncSimpleTreeFromEmpty)
{
- DebugScopedSetImplThread impl;
-
LayerTreeSettings settings;
- scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0);
+ FakeProxy proxy(scoped_ptr<Thread>(NULL));
+ DebugScopedSetImplThread impl(&proxy);
+ scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0, &proxy);
scoped_refptr<Layer> layerTreeRoot = Layer::create();
layerTreeRoot->addChild(Layer::create());
@@ -158,11 +157,12 @@ TEST(TreeSynchronizerTest, syncSimpleTreeFromEmpty)
// Constructs a very simple tree and synchronizes it attempting to reuse some layers
TEST(TreeSynchronizerTest, syncSimpleTreeReusingLayers)
{
- DebugScopedSetImplThread impl;
std::vector<int> layerImplDestructionList;
LayerTreeSettings settings;
- scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0);
+ FakeProxy proxy(scoped_ptr<Thread>(NULL));
+ DebugScopedSetImplThread impl(&proxy);
+ scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0, &proxy);
scoped_refptr<Layer> layerTreeRoot = MockLayer::create(&layerImplDestructionList);
layerTreeRoot->addChild(MockLayer::create(&layerImplDestructionList));
@@ -188,11 +188,12 @@ TEST(TreeSynchronizerTest, syncSimpleTreeReusingLayers)
// 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;
- scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0);
+ FakeProxy proxy(scoped_ptr<Thread>(NULL));
+ DebugScopedSetImplThread impl(&proxy);
+ scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0, &proxy);
// 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.
@@ -218,10 +219,10 @@ TEST(TreeSynchronizerTest, syncSimpleTreeAndTrackStackingOrderChange)
TEST(TreeSynchronizerTest, syncSimpleTreeAndProperties)
{
- DebugScopedSetImplThread impl;
-
LayerTreeSettings settings;
- scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0);
+ FakeProxy proxy(scoped_ptr<Thread>(NULL));
+ DebugScopedSetImplThread impl(&proxy);
+ scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0, &proxy);
scoped_refptr<Layer> layerTreeRoot = Layer::create();
layerTreeRoot->addChild(Layer::create());
@@ -254,11 +255,12 @@ TEST(TreeSynchronizerTest, syncSimpleTreeAndProperties)
TEST(TreeSynchronizerTest, reuseLayerImplsAfterStructuralChange)
{
- DebugScopedSetImplThread impl;
std::vector<int> layerImplDestructionList;
LayerTreeSettings settings;
- scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0);
+ FakeProxy proxy(scoped_ptr<Thread>(NULL));
+ DebugScopedSetImplThread impl(&proxy);
+ scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0, &proxy);
// Set up a tree with this sort of structure:
// root --- A --- B ---+--- C
@@ -304,11 +306,12 @@ TEST(TreeSynchronizerTest, reuseLayerImplsAfterStructuralChange)
// 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;
- scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0);
+ FakeProxy proxy(scoped_ptr<Thread>(NULL));
+ DebugScopedSetImplThread impl(&proxy);
+ scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0, &proxy);
scoped_refptr<Layer> oldLayerTreeRoot = MockLayer::create(&layerImplDestructionList);
oldLayerTreeRoot->addChild(MockLayer::create(&layerImplDestructionList));
@@ -339,10 +342,10 @@ TEST(TreeSynchronizerTest, syncSimpleTreeThenDestroy)
// Constructs+syncs a tree with mask, replica, and replica mask layers.
TEST(TreeSynchronizerTest, syncMaskReplicaAndReplicaMaskLayers)
{
- DebugScopedSetImplThread impl;
-
LayerTreeSettings settings;
- scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0);
+ FakeProxy proxy(scoped_ptr<Thread>(NULL));
+ DebugScopedSetImplThread impl(&proxy);
+ scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0, &proxy);
scoped_refptr<Layer> layerTreeRoot = Layer::create();
layerTreeRoot->addChild(Layer::create());
@@ -385,10 +388,10 @@ TEST(TreeSynchronizerTest, syncMaskReplicaAndReplicaMaskLayers)
TEST(TreeSynchronizerTest, synchronizeAnimations)
{
- DebugScopedSetImplThread impl;
-
LayerTreeSettings settings;
- scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0);
+ FakeProxy proxy(scoped_ptr<Thread>(NULL));
+ DebugScopedSetImplThread impl(&proxy);
+ scoped_ptr<LayerTreeHostImpl> hostImpl = LayerTreeHostImpl::create(settings, 0, &proxy);
scoped_refptr<Layer> layerTreeRoot = Layer::create();
« no previous file with comments | « cc/tiled_layer_unittest.cc ('k') | cc/video_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698