Index: ui/gfx/compositor/layer_unittest.cc |
diff --git a/ui/gfx/compositor/layer_unittest.cc b/ui/gfx/compositor/layer_unittest.cc |
index 5c358a976975b944edb072a246efdc718d885d51..7445256c199f3696227ee0e16b7e31ed0e055ada 100644 |
--- a/ui/gfx/compositor/layer_unittest.cc |
+++ b/ui/gfx/compositor/layer_unittest.cc |
@@ -465,37 +465,53 @@ class LayerWithNullDelegateTest : public LayerWithDelegateTest { |
return layer; |
} |
+ void RunPendingMessages() { |
+ MessageLoopForUI::current()->RunAllPending(); |
+ } |
+ |
private: |
scoped_ptr<NullLayerDelegate> default_layer_delegate_; |
DISALLOW_COPY_AND_ASSIGN(LayerWithNullDelegateTest); |
}; |
+// With the webkit compositor, we don't explicitly textures for layers, making |
+// tests that check that we do fail. |
+#if defined(USE_WEBKIT_COMPOSITOR) |
+#define NOT_APPLICABLE_TO_WEBKIT_COMPOSITOR(X) DISABLED_ ## X |
+#else |
+#define NOT_APPLICABLE_TO_WEBKIT_COMPOSITOR(X) X |
+#endif |
+ |
// Verifies that a layer which is set never to have a texture does not |
// get a texture when SetFillsBoundsOpaquely is called. |
-TEST_F(LayerWithNullDelegateTest, LayerNoTextureSetFillsBoundsOpaquely) { |
+TEST_F(LayerWithNullDelegateTest, |
+ NOT_APPLICABLE_TO_WEBKIT_COMPOSITOR( |
+ LayerNoTextureSetFillsBoundsOpaquely)) { |
scoped_ptr<Layer> parent(CreateNoTextureLayer(gfx::Rect(0, 0, 400, 400))); |
scoped_ptr<Layer> child(CreateNoTextureLayer(gfx::Rect(50, 50, 100, 100))); |
parent->Add(child.get()); |
compositor()->SetRootLayer(parent.get()); |
+ parent->SetFillsBoundsOpaquely(true); |
+ child->SetFillsBoundsOpaquely(true); |
+ Draw(); |
+ RunPendingMessages(); |
+ EXPECT_TRUE(child->texture() == NULL); |
+ EXPECT_TRUE(parent->texture() == NULL); |
+ |
+ parent->SetFillsBoundsOpaquely(false); |
+ child->SetFillsBoundsOpaquely(false); |
Draw(); |
+ RunPendingMessages(); |
EXPECT_TRUE(child->texture() == NULL); |
EXPECT_TRUE(parent->texture() == NULL); |
} |
-// With the webkit compositor, we don't explicitly textures for layers, making |
-// tests that check that we do fail. |
-#if defined(USE_WEBKIT_COMPOSITOR) |
-#define WEBKIT_COMPOSITOR_FAILS(X) FAILS_ ## X |
-#else |
-#define WEBKIT_COMPOSITOR_FAILS(X) X |
-#endif |
- |
// Verifies that a layer does not have a texture when the hole is the size |
// of the parent layer. |
TEST_F(LayerWithNullDelegateTest, |
- WEBKIT_COMPOSITOR_FAILS(LayerNoTextureHoleSizeOfLayer)) { |
+ NOT_APPLICABLE_TO_WEBKIT_COMPOSITOR(LayerNoTextureHoleSizeOfLayer)) { |
scoped_ptr<Layer> parent(CreateTextureRootLayer(gfx::Rect(0, 0, 400, 400))); |
scoped_ptr<Layer> child(CreateTextureLayer(gfx::Rect(50, 50, 100, 100))); |
parent->Add(child.get()); |
@@ -511,7 +527,7 @@ TEST_F(LayerWithNullDelegateTest, |
// Verifies that a layer which has opacity == 0 does not have a texture. |
TEST_F(LayerWithNullDelegateTest, |
- WEBKIT_COMPOSITOR_FAILS(LayerNoTextureTransparent)) { |
+ NOT_APPLICABLE_TO_WEBKIT_COMPOSITOR(LayerNoTextureTransparent)) { |
scoped_ptr<Layer> parent(CreateTextureRootLayer(gfx::Rect(0, 0, 400, 400))); |
scoped_ptr<Layer> child(CreateTextureLayer(gfx::Rect(50, 50, 100, 100))); |
parent->Add(child.get()); |
@@ -535,7 +551,7 @@ TEST_F(LayerWithNullDelegateTest, |
// Verifies that no texture is created for a layer with empty bounds. |
TEST_F(LayerWithNullDelegateTest, |
- WEBKIT_COMPOSITOR_FAILS(LayerTextureNonEmptySchedulePaint)) { |
+ NOT_APPLICABLE_TO_WEBKIT_COMPOSITOR(LayerTextureNonEmptySchedulePaint)) { |
scoped_ptr<Layer> layer(CreateTextureRootLayer(gfx::Rect(0, 0, 0, 0))); |
Draw(); |
EXPECT_TRUE(layer->texture() == NULL); |
@@ -620,7 +636,8 @@ TEST_F(LayerWithNullDelegateTest, HoleWithNinetyDegreeTransforms) { |
// +- L12 (no texture) (added after L1 is already set as root-layer) |
// +- L121 (texture) |
// +- L122 (texture) |
-TEST_F(LayerWithNullDelegateTest, WEBKIT_COMPOSITOR_FAILS(NoCompositor)) { |
+TEST_F(LayerWithNullDelegateTest, |
+ NOT_APPLICABLE_TO_WEBKIT_COMPOSITOR(NoCompositor)) { |
scoped_ptr<Layer> l1(CreateLayer(Layer::LAYER_HAS_NO_TEXTURE)); |
scoped_ptr<Layer> l11(CreateLayer(Layer::LAYER_HAS_TEXTURE)); |
scoped_ptr<Layer> l12(CreateLayer(Layer::LAYER_HAS_NO_TEXTURE)); |
@@ -729,7 +746,7 @@ TEST_F(LayerWithNullDelegateTest, Visibility) { |
// Checks that the invalid rect assumes correct values when setting bounds. |
// TODO(vollick): for USE_WEBKIT_COMPOSITOR, use WebKit's dirty rect. |
TEST_F(LayerWithNullDelegateTest, |
- WEBKIT_COMPOSITOR_FAILS(SetBoundsInvalidRect)) { |
+ NOT_APPLICABLE_TO_WEBKIT_COMPOSITOR(SetBoundsInvalidRect)) { |
scoped_ptr<Layer> l1(CreateTextureLayer(gfx::Rect(0, 0, 200, 200))); |
compositor()->SetRootLayer(l1.get()); |