From b49c29b0ee11c0228c0a5c210edcdff79e04bb12 Mon Sep 17 00:00:00 2001 From: groby Date: Wed, 24 Sep 2014 18:06:14 -0700 Subject: Fix memory leak in test BUG=none TBR=mpearson@chromium.org R=jiayul@chromium.org Review URL: https://codereview.chromium.org/601033002 Cr-Commit-Position: refs/heads/master@{#296604} --- components/omnibox/base_search_provider_unittest.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'components') diff --git a/components/omnibox/base_search_provider_unittest.cc b/components/omnibox/base_search_provider_unittest.cc index 1a64ffa..42a9f18 100644 --- a/components/omnibox/base_search_provider_unittest.cc +++ b/components/omnibox/base_search_provider_unittest.cc @@ -118,7 +118,7 @@ class BaseSearchProviderTest : public testing::Test { TEST_F(BaseSearchProviderTest, PreserveAnswersWhenDeduplicating) { TemplateURLData data; data.SetURL("http://foo.com/url?bar={searchTerms}"); - TemplateURL* template_url = new TemplateURL(data); + scoped_ptr template_url(new TemplateURL(data)); TestBaseSearchProvider::MatchMap map; base::string16 query = base::ASCIIToUTF16("weather los angeles"); @@ -128,7 +128,7 @@ TEST_F(BaseSearchProviderTest, PreserveAnswersWhenDeduplicating) { EXPECT_CALL(*provider_, GetInput(_)) .WillRepeatedly(Return(AutocompleteInput())); EXPECT_CALL(*provider_, GetTemplateURL(_)) - .WillRepeatedly(Return(template_url)); + .WillRepeatedly(Return(template_url.get())); SearchSuggestionParser::SuggestResult more_relevant( query, AutocompleteMatchType::SEARCH_HISTORY, query, base::string16(), -- cgit v1.1