summaryrefslogtreecommitdiffstats
path: root/cc/layer_tree_host_common_unittest.cc
diff options
context:
space:
mode:
authorhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-05 07:17:46 +0000
committerhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-05 07:17:46 +0000
commit068d7ef6aed7f5a7bdaf1e8d28b422c547be294d (patch)
treea66fd6a12e3a9ae7ef16c66043fd4e4bebe4d28c /cc/layer_tree_host_common_unittest.cc
parent2bddc10a9e71bd3e7d7f010b46ec96c7ab623336 (diff)
downloadchromium_src-068d7ef6aed7f5a7bdaf1e8d28b422c547be294d.zip
chromium_src-068d7ef6aed7f5a7bdaf1e8d28b422c547be294d.tar.gz
chromium_src-068d7ef6aed7f5a7bdaf1e8d28b422c547be294d.tar.bz2
A speculative Revert for r165872 - Remove static thread pointers from CC, attempt 2
BUG=152904 Review URL: https://chromiumcodereview.appspot.com/11232051 TBR=aelias@chromium.org Review URL: https://codereview.chromium.org/11369071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165907 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layer_tree_host_common_unittest.cc')
-rw-r--r--cc/layer_tree_host_common_unittest.cc44
1 files changed, 44 insertions, 0 deletions
diff --git a/cc/layer_tree_host_common_unittest.cc b/cc/layer_tree_host_common_unittest.cc
index 4bc3598..e18137a 100644
--- a/cc/layer_tree_host_common_unittest.cc
+++ b/cc/layer_tree_host_common_unittest.cc
@@ -791,6 +791,8 @@ TEST(LayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWithD
{
// This test checks for correct scroll compensation when the fixed-position container
// is the direct parent of the fixed-position layer.
+
+ DebugScopedSetImplThread scopedImplThread;
scoped_ptr<LayerImpl> root = createTreeForFixedPositionTests();
LayerImpl* child = root->children()[0];
LayerImpl* grandChild = child->children()[0];
@@ -830,6 +832,8 @@ TEST(LayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWithT
// Transforms are in general non-commutative; using something like a non-uniform scale
// helps to verify that translations and non-uniform scales are applied in the correct
// order.
+
+ DebugScopedSetImplThread scopedImplThread;
scoped_ptr<LayerImpl> root = createTreeForFixedPositionTests();
LayerImpl* child = root->children()[0];
LayerImpl* grandChild = child->children()[0];
@@ -871,6 +875,8 @@ TEST(LayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWithD
{
// This test checks for correct scroll compensation when the fixed-position container
// is NOT the direct parent of the fixed-position layer.
+ DebugScopedSetImplThread scopedImplThread;
+
scoped_ptr<LayerImpl> root = createTreeForFixedPositionTests();
LayerImpl* child = root->children()[0];
LayerImpl* grandChild = child->children()[0];
@@ -913,6 +919,8 @@ TEST(LayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWithD
// This test checks for correct scroll compensation when the fixed-position container
// is NOT the direct parent of the fixed-position layer, and the hierarchy has various
// transforms that have to be processed in the correct order.
+ DebugScopedSetImplThread scopedImplThread;
+
scoped_ptr<LayerImpl> root = createTreeForFixedPositionTests();
LayerImpl* child = root->children()[0];
LayerImpl* grandChild = child->children()[0];
@@ -973,6 +981,8 @@ TEST(LayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWithM
// This test checks for correct scroll compensation when the fixed-position container
// is NOT the direct parent of the fixed-position layer, and the hierarchy has various
// transforms that have to be processed in the correct order.
+ DebugScopedSetImplThread scopedImplThread;
+
scoped_ptr<LayerImpl> root = createTreeForFixedPositionTests();
LayerImpl* child = root->children()[0];
LayerImpl* grandChild = child->children()[0];
@@ -1033,6 +1043,8 @@ TEST(LayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWithI
// contributes to a different renderSurface than the fixed-position layer. In this
// case, the surface drawTransforms also have to be accounted for when checking the
// scrollDelta.
+ DebugScopedSetImplThread scopedImplThread;
+
scoped_ptr<LayerImpl> root = createTreeForFixedPositionTests();
LayerImpl* child = root->children()[0];
LayerImpl* grandChild = child->children()[0];
@@ -1104,6 +1116,8 @@ TEST(LayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWithM
// contributes to a different renderSurface than the fixed-position layer, with
// additional renderSurfaces in-between. This checks that the conversion to ancestor
// surfaces is accumulated properly in the final matrix transform.
+ DebugScopedSetImplThread scopedImplThread;
+
scoped_ptr<LayerImpl> root = createTreeForFixedPositionTests();
LayerImpl* child = root->children()[0];
LayerImpl* grandChild = child->children()[0];
@@ -1213,6 +1227,8 @@ TEST(LayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWithC
// itself has a renderSurface. In this case, the container layer should be treated
// like a layer that contributes to a renderTarget, and that renderTarget
// is completely irrelevant; it should not affect the scroll compensation.
+ DebugScopedSetImplThread scopedImplThread;
+
scoped_ptr<LayerImpl> root = createTreeForFixedPositionTests();
LayerImpl* child = root->children()[0];
LayerImpl* grandChild = child->children()[0];
@@ -1258,6 +1274,8 @@ TEST(LayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerThatI
// This test checks the scenario where a fixed-position layer also happens to be a
// container itself for a descendant fixed position layer. In particular, the layer
// should not accidentally be fixed to itself.
+ DebugScopedSetImplThread scopedImplThread;
+
scoped_ptr<LayerImpl> root = createTreeForFixedPositionTests();
LayerImpl* child = root->children()[0];
LayerImpl* grandChild = child->children()[0];
@@ -1293,6 +1311,8 @@ TEST(LayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerThatH
// This test checks scroll compensation when a fixed-position layer does not find any
// ancestor that is a "containerForFixedPositionLayers". In this situation, the layer should
// be fixed to the viewport -- not the rootLayer, which may have transforms of its own.
+ DebugScopedSetImplThread scopedImplThread;
+
scoped_ptr<LayerImpl> root = createTreeForFixedPositionTests();
LayerImpl* child = root->children()[0];
LayerImpl* grandChild = child->children()[0];
@@ -2664,6 +2684,8 @@ TEST(LayerTreeHostCommonTest, verifyBackFaceCullingWithPreserves3dForFlatteningS
TEST(LayerTreeHostCommonTest, verifyHitTestingForEmptyLayerList)
{
// Hit testing on an empty renderSurfaceLayerList should return a null pointer.
+ DebugScopedSetImplThread thisScopeIsOnImplThread;
+
std::vector<LayerImpl*> renderSurfaceLayerList;
gfx::Point testPoint(0, 0);
@@ -2677,6 +2699,8 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForEmptyLayerList)
TEST(LayerTreeHostCommonTest, verifyHitTestingForSingleLayer)
{
+ DebugScopedSetImplThread thisScopeIsOnImplThread;
+
scoped_ptr<LayerImpl> root = LayerImpl::create(12345);
WebTransformationMatrix identityMatrix;
@@ -2717,6 +2741,8 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForSingleLayer)
TEST(LayerTreeHostCommonTest, verifyHitTestingForUninvertibleTransform)
{
+ DebugScopedSetImplThread thisScopeIsOnImplThread;
+
scoped_ptr<LayerImpl> root = LayerImpl::create(12345);
WebTransformationMatrix uninvertibleTransform;
@@ -2776,6 +2802,8 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForUninvertibleTransform)
TEST(LayerTreeHostCommonTest, verifyHitTestingForSinglePositionedLayer)
{
+ DebugScopedSetImplThread thisScopeIsOnImplThread;
+
scoped_ptr<LayerImpl> root = LayerImpl::create(12345);
WebTransformationMatrix identityMatrix;
@@ -2817,6 +2845,8 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForSinglePositionedLayer)
TEST(LayerTreeHostCommonTest, verifyHitTestingForSingleRotatedLayer)
{
+ DebugScopedSetImplThread thisScopeIsOnImplThread;
+
scoped_ptr<LayerImpl> root = LayerImpl::create(12345);
WebTransformationMatrix identityMatrix;
@@ -2866,6 +2896,8 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForSingleRotatedLayer)
TEST(LayerTreeHostCommonTest, verifyHitTestingForSinglePerspectiveLayer)
{
+ DebugScopedSetImplThread thisScopeIsOnImplThread;
+
scoped_ptr<LayerImpl> root = LayerImpl::create(12345);
WebTransformationMatrix identityMatrix;
@@ -2926,6 +2958,8 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForSingleLayerWithScaledContents)
// contentsScale is ignored, then hit testing will mis-interpret the visibleContentRect
// as being larger than the actual bounds of the layer.
//
+ DebugScopedSetImplThread thisScopeIsOnImplThread;
+
scoped_ptr<LayerImpl> root = LayerImpl::create(1);
WebTransformationMatrix identityMatrix;
@@ -2987,6 +3021,8 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForSimpleClippedLayer)
{
// Test that hit-testing will only work for the visible portion of a layer, and not
// the entire layer bounds. Here we just test the simple axis-aligned case.
+ DebugScopedSetImplThread thisScopeIsOnImplThread;
+
WebTransformationMatrix identityMatrix;
gfx::PointF anchor(0, 0);
@@ -3053,6 +3089,8 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForMultiClippedRotatedLayer)
// combined create a triangle. The rotatedLeaf will only be visible where it overlaps
// this triangle.
//
+ DebugScopedSetImplThread thisScopeIsOnImplThread;
+
scoped_ptr<LayerImpl> root = LayerImpl::create(123);
WebTransformationMatrix identityMatrix;
@@ -3151,6 +3189,8 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForNonClippingIntermediateLayer)
{
// This test checks that hit testing code does not accidentally clip to layer
// bounds for a layer that actually does not clip.
+ DebugScopedSetImplThread thisScopeIsOnImplThread;
+
WebTransformationMatrix identityMatrix;
gfx::PointF anchor(0, 0);
@@ -3210,6 +3250,8 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForNonClippingIntermediateLayer)
TEST(LayerTreeHostCommonTest, verifyHitTestingForMultipleLayers)
{
+ DebugScopedSetImplThread thisScopeIsOnImplThread;
+
scoped_ptr<LayerImpl> root = LayerImpl::create(1);
WebTransformationMatrix identityMatrix;
@@ -3313,6 +3355,8 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForMultipleLayerLists)
// The geometry is set up similarly to the previous case, but
// all layers are forced to be renderSurfaces now.
//
+ DebugScopedSetImplThread thisScopeIsOnImplThread;
+
scoped_ptr<LayerImpl> root = LayerImpl::create(1);
WebTransformationMatrix identityMatrix;