diff options
author | erikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-18 19:28:45 +0000 |
---|---|---|
committer | erikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-18 19:28:45 +0000 |
commit | 1d6a0a548fb07fbcfce57c6634714234dc1625bb (patch) | |
tree | 68f5c4418a038054708170dd9c517248c08330b9 /chrome/browser/tabs | |
parent | 21dec3879b53f3de1afad9f7147b011415bbc7f9 (diff) | |
download | chromium_src-1d6a0a548fb07fbcfce57c6634714234dc1625bb.zip chromium_src-1d6a0a548fb07fbcfce57c6634714234dc1625bb.tar.gz chromium_src-1d6a0a548fb07fbcfce57c6634714234dc1625bb.tar.bz2 |
Fix an old leak in tab_strip_model_unittest which had recently contributed to a new leak showing up. The leak was caused by not cleaning up after ReplaceTabContents.
Review URL: http://codereview.chromium.org/2954
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2374 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tabs')
-rw-r--r-- | chrome/browser/tabs/tab_strip_model_unittest.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/browser/tabs/tab_strip_model_unittest.cc b/chrome/browser/tabs/tab_strip_model_unittest.cc index 98552cf..6b24dba 100644 --- a/chrome/browser/tabs/tab_strip_model_unittest.cc +++ b/chrome/browser/tabs/tab_strip_model_unittest.cc @@ -325,6 +325,10 @@ TEST_F(TabStripModelTest, TestBasicAPI) { TabContents* replacement_contents3 = CreateReplacementContents(); { tabstrip.ReplaceTabContentsAt(2, replacement_contents3); + // ReplaceTabContentsAt doesn't delete the source. It depends on + // NavigationCollector, which is not part of this test. + contents3->Destroy(); + EXPECT_EQ(2, observer.GetStateCount()); State s1(replacement_contents3, 2, MockTabStripModelObserver::CHANGE); EXPECT_TRUE(observer.StateEquals(0, s1)); @@ -339,6 +343,9 @@ TEST_F(TabStripModelTest, TestBasicAPI) { TabContents* replacement_contents2 = CreateReplacementContents(); { tabstrip.ReplaceTabContentsAt(1, replacement_contents2); + // ReplaceTabContentsAt doesn't delete the source. It depends on + // NavigationCollector, which is not part of this test. + contents2->Destroy(); EXPECT_EQ(1, observer.GetStateCount()); State s1(replacement_contents2, 1, MockTabStripModelObserver::CHANGE); |