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

Unified Diff: ui/views/controls/tabbed_pane/tabbed_pane_unittest.cc

Issue 10825110: Valgrind/Heapchecker: Fix leaks in TabbedPaneTest. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/tabbed_pane/tabbed_pane_unittest.cc
===================================================================
--- ui/views/controls/tabbed_pane/tabbed_pane_unittest.cc (revision 149223)
+++ ui/views/controls/tabbed_pane/tabbed_pane_unittest.cc (working copy)
@@ -100,6 +100,12 @@
// If we switch to the other tab, it should get assigned the same bounds.
tabbed_pane->SelectTabAt(1);
EXPECT_EQ(bounds, child2->bounds());
+
+ // Clean up.
+ delete tabbed_pane->RemoveTabAtIndex(0);
+ EXPECT_EQ(1, tabbed_pane->GetTabCount());
+ delete tabbed_pane->RemoveTabAtIndex(0);
+ EXPECT_EQ(0, tabbed_pane->GetTabCount());
}
void TabbedPaneTest::TestAddRemove(TabbedPane* tabbed_pane) {
@@ -142,6 +148,13 @@
// Remove the first one.
delete tabbed_pane->RemoveTabAtIndex(0);
EXPECT_EQ(0, tabbed_pane->GetSelectedTabIndex());
+
+ // Clean up the other panes.
+ EXPECT_EQ(3, tabbed_pane->GetTabCount());
+ delete tabbed_pane->RemoveTabAtIndex(0);
+ delete tabbed_pane->RemoveTabAtIndex(0);
+ delete tabbed_pane->RemoveTabAtIndex(0);
+ EXPECT_EQ(0, tabbed_pane->GetTabCount());
}
// Tests TabbedPane::GetPreferredSize() and TabbedPane::Layout().
@@ -167,4 +180,4 @@
#endif
}
-} // namespace views
+} // namespace views
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698