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

Unified Diff: chrome/browser/component_updater/component_updater_service_unittest.cc

Issue 9332004: Fix leak in ComponentUpdaterTest.ProdVersionCheck. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unnecessary <vector> include. Created 8 years, 10 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 | tools/heapcheck/suppressions.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | tools/heapcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698