summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorerikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-18 19:28:45 +0000
committererikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-18 19:28:45 +0000
commit1d6a0a548fb07fbcfce57c6634714234dc1625bb (patch)
tree68f5c4418a038054708170dd9c517248c08330b9 /chrome
parent21dec3879b53f3de1afad9f7147b011415bbc7f9 (diff)
downloadchromium_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')
-rw-r--r--chrome/browser/tabs/tab_strip_model_unittest.cc7
-rw-r--r--chrome/test/data/purify/unit_tests.exe_MLK_flakey.txt59
2 files changed, 7 insertions, 59 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);
diff --git a/chrome/test/data/purify/unit_tests.exe_MLK_flakey.txt b/chrome/test/data/purify/unit_tests.exe_MLK_flakey.txt
index 951467c..17ec860 100644
--- a/chrome/test/data/purify/unit_tests.exe_MLK_flakey.txt
+++ b/chrome/test/data/purify/unit_tests.exe_MLK_flakey.txt
@@ -36,62 +36,3 @@ Alloc Location
testing/gtest/src/gtest.cc testing::Test::Run(void)
^^^
-TabStripModelTest::CreateTabContents(void) [unit_tests.exe]
-Alloc Location
- ...
- chrome/browser/tabs/tab_strip_model_unittest.cc TabStripModelTest::CreateTabContents(void)
- chrome/browser/tabs/tab_strip_model_unittest.cc TabStripModelTest_TestBasicAPI_Test::TestBody(void)
- testing/gtest/src/gtest.cc testing::Test::Run(void)
- ^^^
-
-TabContents::SetupController(Profile *) [unit_tests.exe]
-Alloc Location
- ...
- chrome/browser/tab_contents.cc TabContents::SetupController(Profile *)
- chrome/browser/tabs/tab_strip_model_unittest.cc TabStripModelTest::CreateTabContents(void)
- chrome/browser/tabs/tab_strip_model_unittest.cc TabStripModelTest_TestBasicAPI_Test::TestBody(void)
- testing/gtest/src/gtest.cc testing::Test::Run(void)
- ^^^
-
-?_Allocate@U_Node@?$_List_nod@U?$pair@$$CBW4TabContentsType@@PAVTabContents@@@std@@V?$allocator@U?$pair@$$CBW4TabContentsType@@PAVTabContents@@@std@@@2@@std@@@std@@YAPAU_Node@?$_List_nod@U?$pair@$$CBW4TabContentsType@@PAVTabContents@@@std@@V?$allocator@U?$pair@$$CBW4TabContentsType@@PAVTabContents@@@std@@@2@@0@IPAU120@@Z [unit_tests.exe]
-Alloc Location
- ...
- chrome/browser/navigation_controller.cc NavigationController::NavigationController(TabContents *,Profile *)
- chrome/browser/tab_contents.cc TabContents::SetupController(Profile *)
- chrome/browser/tabs/tab_strip_model_unittest.cc TabStripModelTest::CreateTabContents(void)
- chrome/browser/tabs/tab_strip_model_unittest.cc TabStripModelTest_TestBasicAPI_Test::TestBody(void)
- testing/gtest/src/gtest.cc testing::Test::Run(void)
- ^^^
-
-c:\b\slave\p\build\third_party\platformsdk_vista_6_0\files\vc\include\xmemory.
-Alloc Location
- ...
- chrome/browser/navigation_controller.cc NavigationController::NavigationController(TabContents *,Profile *)
- chrome/browser/tab_contents.cc TabContents::SetupController(Profile *)
- chrome/browser/tabs/tab_strip_model_unittest.cc TabStripModelTest::CreateTabContents(void)
- chrome/browser/tabs/tab_strip_model_unittest.cc TabStripModelTest_TestBasicAPI_Test::TestBody(void)
- testing/gtest/src/gtest.cc testing::Test::Run(void)
- ^^^
-
-?_Allocate@U_Node@?$_List_nod@U?$pair@$$CBW4TabContentsType@@PAVTabContents@@@std@@V?$allocator@U?$pair@$$CBW4TabContentsType@@PAVTabContents@@@std@@@2@@std@@@std@@YAPAU_Node@?$_List_nod@U?$pair@$$CBW4TabContentsType@@PAVTabContents@@@std@@V?$allocator@U?$pair@$$CBW4TabContentsType@@PAVTabContents@@@std@@@2@@0@IPAU120@@Z [unit_tests.exe]
-Alloc Location
- ...
- chrome/browser/navigation_controller.cc NavigationController::RegisterTabContents(TabContents *)
- chrome/browser/navigation_controller.cc NavigationController::NavigationController(TabContents *,Profile *)
- chrome/browser/tab_contents.cc TabContents::SetupController(Profile *)
- chrome/browser/tabs/tab_strip_model_unittest.cc TabStripModelTest::CreateTabContents(void)
- chrome/browser/tabs/tab_strip_model_unittest.cc TabStripModelTest_TestBasicAPI_Test::TestBody(void)
- testing/gtest/src/gtest.cc testing::Test::Run(void)
- ^^^
-
-c:\b\slave\p\build\third_party\platformsdk_vista_6_0\files\vc\include\xmemory.
-Alloc Location
- ...
- chrome/browser/ssl_manager.cc SSLManager::SSLManager(NavigationController *,Delegate::SSLManager *)
- chrome/browser/navigation_controller.cc NavigationController::NavigationController(TabContents *,Profile *)
- chrome/browser/tab_contents.cc TabContents::SetupController(Profile *)
- chrome/browser/tabs/tab_strip_model_unittest.cc TabStripModelTest::CreateTabContents(void)
- chrome/browser/tabs/tab_strip_model_unittest.cc TabStripModelTest_TestBasicAPI_Test::TestBody(void)
- testing/gtest/src/gtest.cc testing::Test::Run(void)
- ^^^
-