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

Side by Side Diff: cc/layer_impl_unittest.cc

Issue 11369071: A speculative Revert for r165872 - Remove static thread pointers from CC, attempt 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/layer_impl.cc ('k') | cc/layer_sorter_unittest.cc » ('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 "config.h" 5 #include "config.h"
6 6
7 #include "cc/layer_impl.h" 7 #include "cc/layer_impl.h"
8 8
9 #include "cc/single_thread_proxy.h" 9 #include "cc/single_thread_proxy.h"
10 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 EXPECT_FALSE(grandChild->layerPropertyChanged()); \ 51 EXPECT_FALSE(grandChild->layerPropertyChanged()); \
52 EXPECT_TRUE(root->layerSurfacePropertyChanged()) 52 EXPECT_TRUE(root->layerSurfacePropertyChanged())
53 53
54 TEST(LayerImplTest, verifyLayerChangesAreTrackedProperly) 54 TEST(LayerImplTest, verifyLayerChangesAreTrackedProperly)
55 { 55 {
56 // 56 //
57 // This test checks that layerPropertyChanged() has the correct behavior. 57 // This test checks that layerPropertyChanged() has the correct behavior.
58 // 58 //
59 59
60 // The constructor on this will fake that we are on the correct thread. 60 // The constructor on this will fake that we are on the correct thread.
61 DebugScopedSetImplThread setImplThread;
62
61 // Create a simple LayerImpl tree: 63 // Create a simple LayerImpl tree:
62 scoped_ptr<LayerImpl> root = LayerImpl::create(1); 64 scoped_ptr<LayerImpl> root = LayerImpl::create(1);
63 root->addChild(LayerImpl::create(2)); 65 root->addChild(LayerImpl::create(2));
64 LayerImpl* child = root->children()[0]; 66 LayerImpl* child = root->children()[0];
65 child->addChild(LayerImpl::create(3)); 67 child->addChild(LayerImpl::create(3));
66 LayerImpl* grandChild = child->children()[0]; 68 LayerImpl* grandChild = child->children()[0];
67 69
68 // Adding children is an internal operation and should not mark layers as ch anged. 70 // Adding children is an internal operation and should not mark layers as ch anged.
69 EXPECT_FALSE(root->layerPropertyChanged()); 71 EXPECT_FALSE(root->layerPropertyChanged());
70 EXPECT_FALSE(child->layerPropertyChanged()); 72 EXPECT_FALSE(child->layerPropertyChanged());
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setContentsOpaque(true)); 157 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setContentsOpaque(true));
156 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setOpacity(arbitraryNumber)) ; 158 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setOpacity(arbitraryNumber)) ;
157 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setDebugBorderColor(arbitrar yColor)); 159 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setDebugBorderColor(arbitrar yColor));
158 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setDebugBorderWidth(arbitrar yNumber)); 160 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setDebugBorderWidth(arbitrar yNumber));
159 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setDrawsContent(true)); 161 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setDrawsContent(true));
160 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setSublayerTransform(arbitra ryTransform)); 162 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setSublayerTransform(arbitra ryTransform));
161 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setBounds(arbitrarySize)); 163 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setBounds(arbitrarySize));
162 } 164 }
163 165
164 } // namespace 166 } // namespace
OLDNEW
« no previous file with comments | « cc/layer_impl.cc ('k') | cc/layer_sorter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698