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

Unified Diff: ui/views/view_unittest.cc

Issue 10412044: layers: Consolidate the ownership of layers in views::View and aura::Window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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/views/view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view_unittest.cc
diff --git a/ui/views/view_unittest.cc b/ui/views/view_unittest.cc
index 3ebd39e47d879e5865ef48a6b3bf51b0e80323d6..b6ea244460662d28ef9c4ca38429dc934c59a70d 100644
--- a/ui/views/view_unittest.cc
+++ b/ui/views/view_unittest.cc
@@ -3160,6 +3160,21 @@ TEST_F(ViewLayerTest, ReorderUnderWidget) {
EXPECT_EQ(c2->layer(), parent_layer->children()[0]);
}
+// Verifies that the layer of a view can be acquired properly.
+TEST_F(ViewLayerTest, AcquireLayer) {
+ View* content = new View;
+ widget()->SetContentsView(content);
+ View* c1 = new View;
+ c1->SetPaintToLayer(true);
+ EXPECT_TRUE(c1->layer());
+
+ scoped_ptr<ui::Layer> layer(c1->AcquireLayer());
+ EXPECT_EQ(layer.get(), c1->layer());
+
+ layer.reset(c1->RecreateLayer());
+ EXPECT_NE(c1->layer(), layer.get());
+}
+
#endif // USE_AURA
} // namespace views
« no previous file with comments | « ui/views/view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698