Index: ui/compositor/layer_unittest.cc |
diff --git a/ui/compositor/layer_unittest.cc b/ui/compositor/layer_unittest.cc |
index a0c293fe16bac7e5e3a903c2ec0727618cca6519..850d8602faf7558a99848fc2160bc929176f22a8 100644 |
--- a/ui/compositor/layer_unittest.cc |
+++ b/ui/compositor/layer_unittest.cc |
@@ -696,15 +696,9 @@ TEST_F(LayerWithNullDelegateTest, Visibility) { |
EXPECT_TRUE(l1->IsDrawn()); |
EXPECT_TRUE(l2->IsDrawn()); |
EXPECT_TRUE(l3->IsDrawn()); |
-#if defined(WEBLAYER_IS_PURE_VIRTUAL) |
EXPECT_EQ(1.f, l1->web_layer()->opacity()); |
EXPECT_EQ(1.f, l2->web_layer()->opacity()); |
EXPECT_EQ(1.f, l3->web_layer()->opacity()); |
-#else |
- EXPECT_EQ(1.f, l1->web_layer().opacity()); |
- EXPECT_EQ(1.f, l2->web_layer().opacity()); |
- EXPECT_EQ(1.f, l3->web_layer().opacity()); |
-#endif |
compositor()->SetRootLayer(l1.get()); |
@@ -714,31 +708,19 @@ TEST_F(LayerWithNullDelegateTest, Visibility) { |
EXPECT_FALSE(l1->IsDrawn()); |
EXPECT_FALSE(l2->IsDrawn()); |
EXPECT_FALSE(l3->IsDrawn()); |
-#if defined(WEBLAYER_IS_PURE_VIRTUAL) |
EXPECT_EQ(0.f, l1->web_layer()->opacity()); |
-#else |
- EXPECT_EQ(0.f, l1->web_layer().opacity()); |
-#endif |
l3->SetVisible(false); |
EXPECT_FALSE(l1->IsDrawn()); |
EXPECT_FALSE(l2->IsDrawn()); |
EXPECT_FALSE(l3->IsDrawn()); |
-#if defined(WEBLAYER_IS_PURE_VIRTUAL) |
EXPECT_EQ(0.f, l3->web_layer()->opacity()); |
-#else |
- EXPECT_EQ(0.f, l3->web_layer().opacity()); |
-#endif |
l1->SetVisible(true); |
EXPECT_TRUE(l1->IsDrawn()); |
EXPECT_TRUE(l2->IsDrawn()); |
EXPECT_FALSE(l3->IsDrawn()); |
-#if defined(WEBLAYER_IS_PURE_VIRTUAL) |
EXPECT_EQ(1.f, l1->web_layer()->opacity()); |
-#else |
- EXPECT_EQ(1.f, l1->web_layer().opacity()); |
-#endif |
} |
// Checks that stacking-related methods behave as advertised. |
@@ -1146,17 +1128,9 @@ TEST_F(LayerWithRealCompositorTest, MAYBE_ScaleUpDown) { |
EXPECT_EQ("10,20 200x220", root->bounds().ToString()); |
EXPECT_EQ("10,20 140x180", l1->bounds().ToString()); |
-#if defined(WEBLAYER_IS_PURE_VIRTUAL) |
gfx::Size size_in_pixel = root->web_layer()->bounds(); |
-#else |
- gfx::Size size_in_pixel = root->web_layer().bounds(); |
-#endif |
EXPECT_EQ("200x220", size_in_pixel.ToString()); |
-#if defined(WEBLAYER_IS_PURE_VIRTUAL) |
size_in_pixel = l1->web_layer()->bounds(); |
-#else |
- size_in_pixel = l1->web_layer().bounds(); |
-#endif |
EXPECT_EQ("140x180", size_in_pixel.ToString()); |
// No scale change, so no scale notification. |
EXPECT_EQ(0.0f, root_delegate.device_scale_factor()); |
@@ -1171,17 +1145,9 @@ TEST_F(LayerWithRealCompositorTest, MAYBE_ScaleUpDown) { |
EXPECT_EQ("10,20 200x220", root->bounds().ToString()); |
EXPECT_EQ("10,20 140x180", l1->bounds().ToString()); |
// Pixel size must have been scaled up. |
-#if defined(WEBLAYER_IS_PURE_VIRTUAL) |
size_in_pixel = root->web_layer()->bounds(); |
-#else |
- size_in_pixel = root->web_layer().bounds(); |
-#endif |
EXPECT_EQ("400x440", size_in_pixel.ToString()); |
-#if defined(WEBLAYER_IS_PURE_VIRTUAL) |
size_in_pixel = l1->web_layer()->bounds(); |
-#else |
- size_in_pixel = l1->web_layer().bounds(); |
-#endif |
EXPECT_EQ("280x360", size_in_pixel.ToString()); |
// New scale factor must have been notified. |
EXPECT_EQ(2.0f, root_delegate.device_scale_factor()); |
@@ -1199,17 +1165,9 @@ TEST_F(LayerWithRealCompositorTest, MAYBE_ScaleUpDown) { |
EXPECT_EQ("10,20 200x220", root->bounds().ToString()); |
EXPECT_EQ("10,20 140x180", l1->bounds().ToString()); |
// Pixel size must have been scaled down. |
-#if defined(WEBLAYER_IS_PURE_VIRTUAL) |
size_in_pixel = root->web_layer()->bounds(); |
-#else |
- size_in_pixel = root->web_layer().bounds(); |
-#endif |
EXPECT_EQ("200x220", size_in_pixel.ToString()); |
-#if defined(WEBLAYER_IS_PURE_VIRTUAL) |
size_in_pixel = l1->web_layer()->bounds(); |
-#else |
- size_in_pixel = l1->web_layer().bounds(); |
-#endif |
EXPECT_EQ("140x180", size_in_pixel.ToString()); |
// New scale factor must have been notified. |
EXPECT_EQ(1.0f, root_delegate.device_scale_factor()); |
@@ -1252,11 +1210,7 @@ TEST_F(LayerWithRealCompositorTest, MAYBE_ScaleReparent) { |
root->Add(l1.get()); |
EXPECT_EQ("10,20 140x180", l1->bounds().ToString()); |
-#if defined(WEBLAYER_IS_PURE_VIRTUAL) |
gfx::Size size_in_pixel = l1->web_layer()->bounds(); |
-#else |
- gfx::Size size_in_pixel = l1->web_layer().bounds(); |
-#endif |
EXPECT_EQ("140x180", size_in_pixel.ToString()); |
EXPECT_EQ(0.0f, l1_delegate.device_scale_factor()); |
@@ -1271,21 +1225,13 @@ TEST_F(LayerWithRealCompositorTest, MAYBE_ScaleReparent) { |
GetCompositor()->SetScaleAndSize(2.0f, gfx::Size(500, 500)); |
// Sanity check on root and l1. |
EXPECT_EQ("10,20 200x220", root->bounds().ToString()); |
-#if defined(WEBLAYER_IS_PURE_VIRTUAL) |
size_in_pixel = l1->web_layer()->bounds(); |
-#else |
- size_in_pixel = l1->web_layer().bounds(); |
-#endif |
EXPECT_EQ("140x180", size_in_pixel.ToString()); |
root->Add(l1.get()); |
EXPECT_EQ("10,20 140x180", l1->bounds().ToString()); |
-#if defined(WEBLAYER_IS_PURE_VIRTUAL) |
size_in_pixel = l1->web_layer()->bounds(); |
-#else |
- size_in_pixel = l1->web_layer().bounds(); |
-#endif |
EXPECT_EQ("280x360", size_in_pixel.ToString()); |
EXPECT_EQ(2.0f, l1_delegate.device_scale_factor()); |
RunPendingMessages(); |