diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-10 20:47:10 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-10 20:47:10 +0000 |
commit | b31dbaf51d30c2a37db28874e60724d66050eb97 (patch) | |
tree | 85c05248963ccac50b0c3a84e2e0e723fa0bbbde /ash/test | |
parent | baca781783aa72fb63d9bb621a26fbaba025a4ef (diff) | |
download | chromium_src-b31dbaf51d30c2a37db28874e60724d66050eb97.zip chromium_src-b31dbaf51d30c2a37db28874e60724d66050eb97.tar.gz chromium_src-b31dbaf51d30c2a37db28874e60724d66050eb97.tar.bz2 |
Fix leaks in ash_unittests
also suppressed leaks in non chrome component
plus a couple of cleanups (eliminated unused code/variables)
BUG=144990,146947
TEST=valgrind reports no leak on ash_unittests
Review URL: https://chromiumcodereview.appspot.com/10907101
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155819 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/test')
-rw-r--r-- | ash/test/test_shell_delegate.cc | 3 | ||||
-rw-r--r-- | ash/test/test_shell_delegate.h | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/ash/test/test_shell_delegate.cc b/ash/test/test_shell_delegate.cc index 36e61e8..9496ccf 100644 --- a/ash/test/test_shell_delegate.cc +++ b/ash/test/test_shell_delegate.cc @@ -80,7 +80,8 @@ void TestShellDelegate::ShowTaskManager() { } content::BrowserContext* TestShellDelegate::GetCurrentBrowserContext() { - return new content::TestBrowserContext(); + current_browser_context_.reset(new content::TestBrowserContext()); + return current_browser_context_.get(); } void TestShellDelegate::ToggleSpokenFeedback() { diff --git a/ash/test/test_shell_delegate.h b/ash/test/test_shell_delegate.h index e464d8f..76e80bb 100644 --- a/ash/test/test_shell_delegate.h +++ b/ash/test/test_shell_delegate.h @@ -7,6 +7,7 @@ #include "ash/shell_delegate.h" #include "base/compiler_specific.h" +#include "base/memory/scoped_ptr.h" namespace ash { namespace test { @@ -53,6 +54,7 @@ class TestShellDelegate : public ShellDelegate { private: bool locked_; bool spoken_feedback_enabled_; + scoped_ptr<content::BrowserContext> current_browser_context_; DISALLOW_COPY_AND_ASSIGN(TestShellDelegate); }; |