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

Unified Diff: views/view_unittest.cc

Issue 7104096: views: Simplify View::RemoveAllChildViews() function implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 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 | « views/view.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 fd2ef32443accc22b6fac01642d69a95c78b7d10..d8800808ba73e67b9d848f6f7e951fbc6971985c 100644
--- a/views/view_unittest.cc
+++ b/views/view_unittest.cc
@@ -2006,26 +2006,31 @@ TEST_F(ViewTest, ConvertPointToViewWithTransform) {
// calling RemoveAllChildViews.
// The tree looks like this:
// root
-// |-- child
+// |-- child1
// | |-- foo
// | |-- bar0
// | |-- bar1
-// +-------|-- bar2
+// | |-- bar2
+// |-- child2
+// +-- child3
TEST_F(ViewTest, RemoveAllChildViews) {
View root;
- View* child = new View();
- root.AddChildView(child);
+ View* child1 = new View();
+ root.AddChildView(child1);
+
+ for (int i = 0; i < 2; ++i)
+ root.AddChildView(new View());
View* foo = new View();
- child->AddChildView(foo);
+ child1->AddChildView(foo);
// Add some nodes to |foo|.
for (int i = 0; i < 3; ++i)
foo->AddChildView(new View());
- ASSERT_EQ(1, root.child_count());
- ASSERT_EQ(1, child->child_count());
+ ASSERT_EQ(3, root.child_count());
+ ASSERT_EQ(1, child1->child_count());
ASSERT_EQ(3, foo->child_count());
// Now remove all child views from root.
« no previous file with comments | « views/view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698