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

Unified Diff: ui/views/view_unittest.cc

Issue 2813353002: Ensure that the focus ring in the bookmarks bar does not paint outside the parent view. (Closed)
Patch Set: Remove newline and global variable Created 3 years, 8 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
« ui/views/view.cc ('K') | « 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 42ba4f3319b73c539f34d668a01a900a3f1d522c..79e92185458a59ce8ebc70398e1808d605c676ae 100644
--- a/ui/views/view_unittest.cc
+++ b/ui/views/view_unittest.cc
@@ -5023,4 +5023,20 @@ TEST_F(ViewObserverTest, ChildViewReordered) {
EXPECT_EQ(child_view2.get(), view_reordered());
}
+// Validates that if a child of a ScrollView adds a layer, then a layer
+// is added to the ScrollView's viewport.
+TEST_F(ViewObserverTest, ScrollViewChildAddLayerTest) {
+ ScrollView* scroll_view = new ScrollView();
sky 2017/04/18 15:35:48 Declare this on the stack, otherwise you're going
ananta 2017/04/18 22:22:39 Changed to unique_ptr
+ scroll_view->SetContents(new View());
+ EXPECT_TRUE(scroll_view->contents_viewport()->layer() == nullptr);
sky 2017/04/18 15:35:48 EXPECT_FALSE(scroll_view->contents_viewport()->lay
ananta 2017/04/18 22:22:39 Done.
+
+ std::unique_ptr<View> child_view = NewView();
+ scroll_view->AddChildView(child_view.get());
+ child_view->SetBounds(0, 0, 100, 100);
+ child_view->SetPaintToLayer(ui::LAYER_TEXTURED);
+
+ EXPECT_TRUE(scroll_view->contents_viewport()->layer() != nullptr);
sky 2017/04/18 15:35:48 EXPECT_TRUE(scroll_view->contents_viewport()->laye
ananta 2017/04/18 22:22:39 Done.
+ scroll_view->RemoveChildView(child_view.get());
+}
+
} // namespace views
« ui/views/view.cc ('K') | « ui/views/view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698