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

Unified Diff: components/omnibox/base_search_provider_unittest.cc

Issue 601033002: Fix memory leak in test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@merge-results
Patch Set: Created 6 years, 3 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: components/omnibox/base_search_provider_unittest.cc
diff --git a/components/omnibox/base_search_provider_unittest.cc b/components/omnibox/base_search_provider_unittest.cc
index 1a64ffaa2a175fbcb2ac01887bf5e901c28afd8b..42a9f1819719fce646e8bb54c0a9ca22e6b1dbbb 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<TemplateURL> 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(),
« 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