Index: chrome/browser/component_updater/component_updater_service_unittest.cc |
diff --git a/chrome/browser/component_updater/component_updater_service_unittest.cc b/chrome/browser/component_updater/component_updater_service_unittest.cc |
index 380c358e6923853373515b930e9c1899cccb767c..6e61c9b72c5492553b7bd977c9832b9395cb90a0 100644 |
--- a/chrome/browser/component_updater/component_updater_service_unittest.cc |
+++ b/chrome/browser/component_updater/component_updater_service_unittest.cc |
@@ -7,6 +7,7 @@ |
#include "base/compiler_specific.h" |
#include "base/file_path.h" |
#include "base/file_util.h" |
+#include "base/memory/scoped_vector.h" |
#include "base/message_loop.h" |
#include "base/path_service.h" |
#include "base/values.h" |
@@ -164,6 +165,10 @@ class ComponentUpdaterTest : public testing::Test { |
content::URLFetcher::SetEnableInterceptionForTests(false); |
} |
+ void TearDown() { |
+ xmlCleanupGlobals(); |
+ } |
+ |
ComponentUpdateService* component_updater() { |
return component_updater_.get(); |
} |
@@ -193,6 +198,7 @@ class ComponentUpdaterTest : public testing::Test { |
} |
com->version = version; |
com->installer = new TestInstaller; |
+ test_installers_.push_back(com->installer); |
component_updater_->RegisterComponent(*com); |
} |
@@ -201,6 +207,8 @@ class ComponentUpdaterTest : public testing::Test { |
FilePath test_data_dir_; |
TestNotificationTracker notification_tracker_; |
TestConfigurator* test_config_; |
+ // ComponentInstaller objects to delete after each test. |
+ ScopedVector<ComponentInstaller> test_installers_; |
}; |
// Verify that our test fixture work and the component updater can |
@@ -298,9 +306,6 @@ TEST_F(ComponentUpdaterTest, CheckCrxSleep) { |
EXPECT_EQ(0, static_cast<TestInstaller*>(com.installer)->install_count()); |
component_updater()->Stop(); |
- |
- delete com.installer; |
- xmlCleanupGlobals(); |
} |
// Verify that we can check for updates and install one component. Besides |
@@ -369,9 +374,6 @@ TEST_F(ComponentUpdaterTest, InstallCrx) { |
EXPECT_EQ(chrome::NOTIFICATION_COMPONENT_UPDATER_SLEEPING, ev3.type); |
component_updater()->Stop(); |
- delete com1.installer; |
- delete com2.installer; |
- xmlCleanupGlobals(); |
} |
// This test checks that the "prodversionmin" value is handled correctly. In |