| Index: views/view_unittest.cc
|
| diff --git a/views/view_unittest.cc b/views/view_unittest.cc
|
| index 679754dbb89780d647c736611d763f16da3db02b..c4a5256e8147e4c3cad04d1aa3e13e3a8740a574 100644
|
| --- a/views/view_unittest.cc
|
| +++ b/views/view_unittest.cc
|
| @@ -2833,14 +2833,18 @@ TEST_F(ViewLayerTest, ToggleOpacityWithLayer) {
|
| child_view->SetBounds(50, 50, 100, 100);
|
| parent_view->AddChildView(child_view);
|
|
|
| + widget()->GetCompositor()->Draw(false);
|
| +
|
| ASSERT_TRUE(child_view->layer() == NULL);
|
| child_view->SetPaintToLayer(true);
|
| child_view->SetFillsBoundsOpaquely(true);
|
| + widget()->GetCompositor()->Draw(false);
|
| ASSERT_TRUE(child_view->layer());
|
| EXPECT_EQ(
|
| gfx::Rect(50, 50, 100, 100), parent_view->layer()->hole_rect());
|
|
|
| child_view->SetFillsBoundsOpaquely(false);
|
| + widget()->GetCompositor()->Draw(false);
|
| EXPECT_TRUE(parent_view->layer()->hole_rect().IsEmpty());
|
| }
|
|
|
| @@ -2867,12 +2871,15 @@ TEST_F(ViewLayerTest, MultipleOpaqueLayers) {
|
| child_view2->SetBounds(150, 150, 200, 200);
|
| parent_view->AddChildView(child_view2);
|
|
|
| + widget()->GetCompositor()->Draw(false);
|
| +
|
| // Only child_view1 is opaque
|
| EXPECT_EQ(
|
| gfx::Rect(50, 50, 100, 100), parent_view->layer()->hole_rect());
|
|
|
| // Both child views are opaque
|
| child_view2->SetFillsBoundsOpaquely(true);
|
| + widget()->GetCompositor()->Draw(false);
|
| EXPECT_TRUE(
|
| gfx::Rect(50, 50, 100, 100) == parent_view->layer()->hole_rect() ||
|
| gfx::Rect(150, 150, 200, 200) == parent_view->layer()->hole_rect());
|
| @@ -2901,13 +2908,16 @@ TEST_F(ViewLayerTest, ToggleVisibilityWithOpaqueLayer) {
|
| child_view->SetPaintToLayer(true);
|
| child_view->SetFillsBoundsOpaquely(true);
|
| parent_view->AddChildView(child_view);
|
| + widget()->GetCompositor()->Draw(false);
|
| EXPECT_EQ(
|
| gfx::Rect(50, 50, 100, 100), parent_view->layer()->hole_rect());
|
|
|
| child_view->SetVisible(false);
|
| + widget()->GetCompositor()->Draw(false);
|
| EXPECT_TRUE(parent_view->layer()->hole_rect().IsEmpty());
|
|
|
| child_view->SetVisible(true);
|
| + widget()->GetCompositor()->Draw(false);
|
| EXPECT_EQ(
|
| gfx::Rect(50, 50, 100, 100), parent_view->layer()->hole_rect());
|
| }
|
|
|