Commit 80b08346 authored by thestig@chromium.org's avatar thestig@chromium.org

Valgrind/Heapchecker: Fix leaks in TabbedPaneTest.

BUG=139842
TEST=none
TBR=ben

Review URL: https://chromiumcodereview.appspot.com/10825110

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149311 0039d316-1c4b-4281-b951-d872f2087c98
parent 472f85e7
...@@ -100,6 +100,12 @@ void TabbedPaneTest::TestSizeAndLayout(TabbedPane* tabbed_pane) { ...@@ -100,6 +100,12 @@ void TabbedPaneTest::TestSizeAndLayout(TabbedPane* tabbed_pane) {
// If we switch to the other tab, it should get assigned the same bounds. // If we switch to the other tab, it should get assigned the same bounds.
tabbed_pane->SelectTabAt(1); tabbed_pane->SelectTabAt(1);
EXPECT_EQ(bounds, child2->bounds()); 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) { void TabbedPaneTest::TestAddRemove(TabbedPane* tabbed_pane) {
...@@ -142,6 +148,13 @@ void TabbedPaneTest::TestAddRemove(TabbedPane* tabbed_pane) { ...@@ -142,6 +148,13 @@ void TabbedPaneTest::TestAddRemove(TabbedPane* tabbed_pane) {
// Remove the first one. // Remove the first one.
delete tabbed_pane->RemoveTabAtIndex(0); delete tabbed_pane->RemoveTabAtIndex(0);
EXPECT_EQ(0, tabbed_pane->GetSelectedTabIndex()); 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(). // Tests TabbedPane::GetPreferredSize() and TabbedPane::Layout().
...@@ -167,4 +180,4 @@ TEST_F(TabbedPaneTest, AddRemove) { ...@@ -167,4 +180,4 @@ TEST_F(TabbedPaneTest, AddRemove) {
#endif #endif
} }
} // namespace views } // namespace views
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment