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

Unified Diff: chrome/browser/search_engines/search_host_to_urls_map_unittest.cc

Issue 10458077: When the Google base URL changes and causes keyword updates, save those to the database. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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
Index: chrome/browser/search_engines/search_host_to_urls_map_unittest.cc
===================================================================
--- chrome/browser/search_engines/search_host_to_urls_map_unittest.cc (revision 139570)
+++ chrome/browser/search_engines/search_host_to_urls_map_unittest.cc (working copy)
@@ -55,7 +55,8 @@
}
TEST_F(SearchHostToURLsMapTest, Remove) {
- provider_map_->Remove(t_urls_[0].get());
+ UIThreadSearchTermsData search_terms_data(NULL);
+ provider_map_->Remove(t_urls_[0].get(), search_terms_data);
const TemplateURL* found_url = provider_map_->GetTemplateURLForHost(host_);
ASSERT_EQ(t_urls_[1].get(), found_url);
@@ -71,27 +72,6 @@
ASSERT_EQ(1, url_count);
}
-TEST_F(SearchHostToURLsMapTest, UpdateGoogleBaseURLs) {
- UIThreadSearchTermsData search_terms_data(NULL);
- std::string google_base_url = "google.com";
- search_terms_data.SetGoogleBaseURL("http://" + google_base_url +"/");
-
- // Add in a url with the templated Google base url.
- TemplateURLData data;
- data.SetURL("{google:baseURL}?q={searchTerms}");
- TemplateURL new_t_url(NULL, data);
- provider_map_->Add(&new_t_url, search_terms_data);
- ASSERT_EQ(&new_t_url, provider_map_->GetTemplateURLForHost(google_base_url));
-
- // Now change the Google base url and verify the result.
- std::string new_google_base_url = "google.co.uk";
- search_terms_data.SetGoogleBaseURL("http://" + new_google_base_url +"/");
- provider_map_->UpdateGoogleBaseURLs(search_terms_data);
- ASSERT_EQ(&new_t_url, provider_map_->GetTemplateURLForHost(
- new_google_base_url));
- search_terms_data.SetGoogleBaseURL(std::string());
-}
-
TEST_F(SearchHostToURLsMapTest, GetTemplateURLForKnownHost) {
const TemplateURL* found_url = provider_map_->GetTemplateURLForHost(host_);
ASSERT_TRUE(found_url == t_urls_[0].get() || found_url == t_urls_[1].get());

Powered by Google App Engine
This is Rietveld 408576698