Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Unified Diff: views/view_unittest.cc

Issue 8368013: Improve Aura overdraw by changing hole calculation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Resetting git state Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/compositor/layer_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
« no previous file with comments | « ui/gfx/compositor/layer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698