diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-24 19:17:14 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-24 19:17:14 +0000 |
commit | 0b1b5e220478890d2ce58f3f369144439b766017 (patch) | |
tree | 44eaacaa6ee0dee7aa5c72e3a5de8db36d4288c6 /chromeos | |
parent | 2acf7ce7bf1917dc59769411ad2657dffc47c3a0 (diff) | |
download | chromium_src-0b1b5e220478890d2ce58f3f369144439b766017.zip chromium_src-0b1b5e220478890d2ce58f3f369144439b766017.tar.gz chromium_src-0b1b5e220478890d2ce58f3f369144439b766017.tar.bz2 |
Fix leak in PowerPolicyControllerTest::SetUp
BUG=235070
TBR=haruki@chromium.org
Review URL: https://chromiumcodereview.appspot.com/14311010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196195 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos')
-rw-r--r-- | chromeos/dbus/power_policy_controller_unittest.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/chromeos/dbus/power_policy_controller_unittest.cc b/chromeos/dbus/power_policy_controller_unittest.cc index 11069a5..7846b0a 100644 --- a/chromeos/dbus/power_policy_controller_unittest.cc +++ b/chromeos/dbus/power_policy_controller_unittest.cc @@ -4,6 +4,7 @@ #include "chromeos/dbus/power_policy_controller.h" +#include "base/memory/scoped_ptr.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/fake_power_manager_client.h" #include "chromeos/dbus/mock_dbus_thread_manager_without_gmock.h" @@ -24,18 +25,19 @@ class PowerPolicyControllerTest : public testing::Test { dbus_manager_ = new MockDBusThreadManagerWithoutGMock; DBusThreadManager::InitializeForTesting(dbus_manager_); // Takes ownership. - policy_controller_ = - new PowerPolicyController(dbus_manager_, &fake_power_client_); + policy_controller_.reset( + new PowerPolicyController(dbus_manager_, &fake_power_client_)); } virtual void TearDown() OVERRIDE { + policy_controller_.reset(); DBusThreadManager::Shutdown(); } protected: MockDBusThreadManagerWithoutGMock* dbus_manager_; // Not owned. FakePowerManagerClient fake_power_client_; - PowerPolicyController* policy_controller_; // Not owned. + scoped_ptr<PowerPolicyController> policy_controller_; }; TEST_F(PowerPolicyControllerTest, Prefs) { |