Index: chrome/browser/search_engines/search_host_to_urls_map_unittest.cc |
=================================================================== |
--- chrome/browser/search_engines/search_host_to_urls_map_unittest.cc (revision 130759) |
+++ chrome/browser/search_engines/search_host_to_urls_map_unittest.cc (working copy) |
@@ -29,11 +29,11 @@ |
void SearchHostToURLsMapTest::SetUp() { |
// Add some entries to the search host map. |
host_ = "www.unittest.com"; |
- t_urls_[0].reset(new TemplateURL()); |
- t_urls_[0]->SetURL("http://" + host_ + "/path1"); |
- t_urls_[1].reset(new TemplateURL()); |
- t_urls_[1]->SetURL("http://" + host_ + "/path2"); |
- |
+ TemplateURLData data; |
+ data.SetURL("http://" + host_ + "/path1"); |
+ t_urls_[0].reset(new TemplateURL(data)); |
+ data.SetURL("http://" + host_ + "/path2"); |
+ t_urls_[1].reset(new TemplateURL(data)); |
std::vector<const TemplateURL*> template_urls; |
template_urls.push_back(t_urls_[0].get()); |
template_urls.push_back(t_urls_[1].get()); |
@@ -45,8 +45,9 @@ |
TEST_F(SearchHostToURLsMapTest, Add) { |
std::string new_host = "example.com"; |
- TemplateURL new_t_url; |
- new_t_url.SetURL("http://" + new_host + "/"); |
+ TemplateURLData data; |
+ data.SetURL("http://" + new_host + "/"); |
+ TemplateURL new_t_url(data); |
UIThreadSearchTermsData search_terms_data; |
provider_map_->Add(&new_t_url, search_terms_data); |
@@ -70,18 +71,6 @@ |
ASSERT_EQ(1, url_count); |
} |
-TEST_F(SearchHostToURLsMapTest, Update) { |
- std::string new_host = "example.com"; |
- TemplateURL new_values; |
- new_values.SetURL("http://" + new_host + "/"); |
- |
- UIThreadSearchTermsData search_terms_data; |
- provider_map_->Update(t_urls_[0].get(), new_values, search_terms_data); |
- |
- ASSERT_EQ(t_urls_[0].get(), provider_map_->GetTemplateURLForHost(new_host)); |
- ASSERT_EQ(t_urls_[1].get(), provider_map_->GetTemplateURLForHost(host_)); |
-} |
- |
TEST_F(SearchHostToURLsMapTest, UpdateGoogleBaseURLs) { |
UIThreadSearchTermsData search_terms_data; |
std::string google_base_url = "google.com"; |
@@ -89,8 +78,9 @@ |
new std::string("http://" + google_base_url +"/")); |
// Add in a url with the templated Google base url. |
- TemplateURL new_t_url; |
- new_t_url.SetURL("{google:baseURL}?q={searchTerms}"); |
+ TemplateURLData data; |
+ data.SetURL("{google:baseURL}?q={searchTerms}"); |
+ TemplateURL new_t_url(data); |
provider_map_->Add(&new_t_url, search_terms_data); |
ASSERT_EQ(&new_t_url, provider_map_->GetTemplateURLForHost(google_base_url)); |