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

Unified Diff: chrome/browser/autocomplete/autocomplete_unittest.cc

Issue 9982018: Move most TemplateURL data members to a new struct, TemplateURLData. This allows us to eliminate t… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 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 | chrome/browser/autocomplete/keyword_provider_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete_unittest.cc
===================================================================
--- chrome/browser/autocomplete/autocomplete_unittest.cc (revision 130759)
+++ chrome/browser/autocomplete/autocomplete_unittest.cc (working copy)
@@ -182,8 +182,9 @@
profile_.CreateTemplateURLService();
// Reset the default TemplateURL.
- TemplateURL* default_t_url = new TemplateURL();
- default_t_url->SetURL("http://defaultturl/{searchTerms}");
+ TemplateURLData data;
+ data.SetURL("http://defaultturl/{searchTerms}");
+ TemplateURL* default_t_url = new TemplateURL(data);
TemplateURLService* turl_model =
TemplateURLServiceFactory::GetForProfile(&profile_);
turl_model->Add(default_t_url);
@@ -192,10 +193,10 @@
ASSERT_NE(0, default_provider_id);
// Create another TemplateURL for KeywordProvider.
- TemplateURL* keyword_t_url = new TemplateURL();
- keyword_t_url->set_short_name(ASCIIToUTF16("k"));
- keyword_t_url->set_keyword(ASCIIToUTF16("k"));
- keyword_t_url->SetURL("http://keyword/{searchTerms}");
+ data.short_name = ASCIIToUTF16("k");
+ data.SetKeyword(ASCIIToUTF16("k"));
+ data.SetURL("http://keyword/{searchTerms}");
+ TemplateURL* keyword_t_url = new TemplateURL(data);
turl_model->Add(keyword_t_url);
ASSERT_NE(0, keyword_t_url->id());
@@ -223,18 +224,19 @@
TemplateURLServiceFactory::GetForProfile(&profile_);
// Create a TemplateURL for KeywordProvider.
- TemplateURL* keyword_t_url = new TemplateURL();
- keyword_t_url->set_short_name(ASCIIToUTF16("foo.com"));
- keyword_t_url->set_keyword(ASCIIToUTF16("foo.com"));
- keyword_t_url->SetURL("http://foo.com/{searchTerms}");
+ TemplateURLData data;
+ data.short_name = ASCIIToUTF16("foo.com");
+ data.SetKeyword(ASCIIToUTF16("foo.com"));
+ data.SetURL("http://foo.com/{searchTerms}");
+ TemplateURL* keyword_t_url = new TemplateURL(data);
turl_model->Add(keyword_t_url);
ASSERT_NE(0, keyword_t_url->id());
// Create another TemplateURL for KeywordProvider.
- keyword_t_url = new TemplateURL();
- keyword_t_url->set_short_name(ASCIIToUTF16("bar.com"));
- keyword_t_url->set_keyword(ASCIIToUTF16("bar.com"));
- keyword_t_url->SetURL("http://bar.com/{searchTerms}");
+ data.short_name = ASCIIToUTF16("bar.com");
+ data.SetKeyword(ASCIIToUTF16("bar.com"));
+ data.SetURL("http://bar.com/{searchTerms}");
+ keyword_t_url = new TemplateURL(data);
turl_model->Add(keyword_t_url);
ASSERT_NE(0, keyword_t_url->id());
« no previous file with comments | « no previous file | chrome/browser/autocomplete/keyword_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698