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

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

Issue 2902373003: Fix memory leak in unit test (Closed)
Patch Set: Created 3 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/component_updater/cros_component_installer_unittest.cc
diff --git a/chrome/browser/component_updater/cros_component_installer_unittest.cc b/chrome/browser/component_updater/cros_component_installer_unittest.cc
index 951771b87b1c6d0210f2b33484dcfb6767c275e8..4c5d00f9881160dbcc410f3f99458508931ffefd 100644
--- a/chrome/browser/component_updater/cros_component_installer_unittest.cc
+++ b/chrome/browser/component_updater/cros_component_installer_unittest.cc
@@ -87,7 +87,8 @@ class FakeInstallerTraits : public ComponentInstallerTraits {
void install_callback(update_client::Error error) {}
TEST_F(CrOSComponentInstallerTest, BPPPCompatibleCrOSComponent) {
- auto* bppp = new BrowserProcessPlatformPart();
+ std::unique_ptr<BrowserProcessPlatformPart> bppp(
sky 2017/05/26 02:27:19 Can you instead declare BPPP on the stack?
xiaochu 2017/05/26 02:47:47 Done.
+ new BrowserProcessPlatformPart());
ASSERT_EQ(bppp->IsCompatibleCrOSComponent("a"), false);
bppp->AddCompatibleCrOSComponent("a");
ASSERT_EQ(bppp->IsCompatibleCrOSComponent("a"), true);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698