Index: ui/compositor/layer_unittest.cc |
diff --git a/ui/compositor/layer_unittest.cc b/ui/compositor/layer_unittest.cc |
index d64ac74eecf2833e63bd3fbf6505c0a9362390af..1ba316df5dd897834729cab592721dff297bfae4 100644 |
--- a/ui/compositor/layer_unittest.cc |
+++ b/ui/compositor/layer_unittest.cc |
@@ -510,7 +510,7 @@ TEST_F(LayerWithDelegateTest, ConvertPointToLayer_Medium) { |
TEST_F(LayerWithRealCompositorTest, Delegate) { |
scoped_ptr<Layer> l1(CreateColorLayer(SK_ColorBLACK, |
- gfx::Rect(20, 20, 400, 400))); |
+ gfx::Rect(20, 20, 1000, 1000))); |
GetCompositor()->SetRootLayer(l1.get()); |
WaitForDraw(); |
@@ -520,21 +520,21 @@ TEST_F(LayerWithRealCompositorTest, Delegate) { |
delegate.AddColor(SK_ColorYELLOW); |
delegate.AddColor(SK_ColorGREEN); |
- l1->SchedulePaint(gfx::Rect(0, 0, 400, 400)); |
+ l1->SchedulePaint(gfx::Rect(0, 0, 1000, 1000)); |
WaitForDraw(); |
EXPECT_EQ(delegate.color_index(), 1); |
- EXPECT_EQ(delegate.paint_size(), l1->bounds().size()); |
+ EXPECT_EQ(delegate.paint_size(), gfx::Size(1030, 1030)); |
danakj
2015/03/03 17:57:05
This bakes in cc internal knowledge into these num
weiliangc
2015/03/04 01:23:57
paint_size() still used here.
(also time to test
weiliangc
2015/03/06 20:42:46
paint_size still needed here, since canvas rect wo
|
- l1->SchedulePaint(gfx::Rect(10, 10, 200, 200)); |
+ l1->SchedulePaint(gfx::Rect(10, 10, 600, 600)); |
WaitForDraw(); |
EXPECT_EQ(delegate.color_index(), 2); |
- EXPECT_EQ(delegate.paint_size(), gfx::Size(200, 200)); |
+ EXPECT_EQ(delegate.paint_size(), gfx::Size(1009, 1009)); |
l1->SchedulePaint(gfx::Rect(5, 5, 50, 50)); |
WaitForDraw(); |
EXPECT_EQ(delegate.color_index(), 0); |
- EXPECT_EQ(delegate.paint_size(), gfx::Size(50, 50)); |
+ EXPECT_EQ(delegate.paint_size(), gfx::Size(527, 527)); |
} |
TEST_F(LayerWithRealCompositorTest, DrawTree) { |
@@ -1308,9 +1308,6 @@ TEST_F(LayerWithRealCompositorTest, ScaleUpDown) { |
EXPECT_EQ(0.0f, root_delegate.device_scale_factor()); |
EXPECT_EQ(0.0f, l1_delegate.device_scale_factor()); |
- EXPECT_EQ("200x220", root_delegate.paint_size().ToString()); |
- EXPECT_EQ("140x180", l1_delegate.paint_size().ToString()); |
- |
// Scale up to 2.0. Changing scale doesn't change the bounds in DIP. |
GetCompositor()->SetScaleAndSize(2.0f, gfx::Size(500, 500)); |
EXPECT_EQ("10,20 200x220", root->bounds().ToString()); |
@@ -1326,10 +1323,6 @@ TEST_F(LayerWithRealCompositorTest, ScaleUpDown) { |
// Canvas size must have been scaled down up. |
WaitForDraw(); |
- EXPECT_EQ("400x440", root_delegate.paint_size().ToString()); |
- EXPECT_EQ("2.0 2.0", root_delegate.ToScaleString()); |
- EXPECT_EQ("280x360", l1_delegate.paint_size().ToString()); |
- EXPECT_EQ("2.0 2.0", l1_delegate.ToScaleString()); |
// Scale down back to 1.0f. |
GetCompositor()->SetScaleAndSize(1.0f, gfx::Size(500, 500)); |
@@ -1346,9 +1339,7 @@ TEST_F(LayerWithRealCompositorTest, ScaleUpDown) { |
// Canvas size must have been scaled down too. |
WaitForDraw(); |
- EXPECT_EQ("200x220", root_delegate.paint_size().ToString()); |
EXPECT_EQ("1.0 1.0", root_delegate.ToScaleString()); |
- EXPECT_EQ("140x180", l1_delegate.paint_size().ToString()); |
EXPECT_EQ("1.0 1.0", l1_delegate.ToScaleString()); |
root_delegate.reset(); |
@@ -1386,8 +1377,6 @@ TEST_F(LayerWithRealCompositorTest, ScaleReparent) { |
EXPECT_EQ(0.0f, l1_delegate.device_scale_factor()); |
WaitForDraw(); |
- EXPECT_EQ("140x180", l1_delegate.paint_size().ToString()); |
- EXPECT_EQ("1.0 1.0", l1_delegate.ToScaleString()); |
// Remove l1 from root and change the scale. |
root->Remove(l1.get()); |
@@ -1405,8 +1394,6 @@ TEST_F(LayerWithRealCompositorTest, ScaleReparent) { |
EXPECT_EQ("140x180", cc_bounds_size.ToString()); |
EXPECT_EQ(2.0f, l1_delegate.device_scale_factor()); |
WaitForDraw(); |
- EXPECT_EQ("280x360", l1_delegate.paint_size().ToString()); |
- EXPECT_EQ("2.0 2.0", l1_delegate.ToScaleString()); |
} |
// Verifies that when changing bounds on a layer that is invisible, and then |