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

Unified Diff: ui/compositor/layer_unittest.cc

Issue 2749993002: compositor: Change how attributes are set during ui::Layer::Clone(). (Closed)
Patch Set: test Created 3 years, 9 months 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/compositor/layer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer_unittest.cc
diff --git a/ui/compositor/layer_unittest.cc b/ui/compositor/layer_unittest.cc
index 8258ac2a68758260c1d37081bf20f752f6d11dca..9056ffe52d10cdeb65e714f3a71b3535ecf638dc 100644
--- a/ui/compositor/layer_unittest.cc
+++ b/ui/compositor/layer_unittest.cc
@@ -790,6 +790,19 @@ TEST_F(LayerWithDelegateTest, Cloning) {
EXPECT_FALSE(clone->layer_inverted());
EXPECT_FALSE(clone->fills_bounds_opaquely());
+ // A solid color layer with transparent color can be marked as opaque. The
+ // clone should retain this state.
+ layer.reset(CreateLayer(LAYER_SOLID_COLOR));
+ layer->SetColor(kTransparent);
+ layer->SetFillsBoundsOpaquely(true);
+
+ clone = layer->Clone();
+ EXPECT_TRUE(clone->GetTargetTransform().IsIdentity());
+ EXPECT_EQ(kTransparent, clone->background_color());
+ EXPECT_EQ(kTransparent, clone->GetTargetColor());
+ EXPECT_FALSE(clone->layer_inverted());
+ EXPECT_TRUE(clone->fills_bounds_opaquely());
+
layer.reset(CreateLayer(LAYER_SOLID_COLOR));
layer->SetVisible(true);
layer->SetOpacity(1.0f);
« no previous file with comments | « ui/compositor/layer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698