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

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

Issue 2806593006: Changed GenerateKeyword to always return keyword in lowercase (Closed)
Patch Set: Fixed after review, round 1 Created 3 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 | components/search_engines/template_url.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search_engines/template_url_service_unittest.cc
diff --git a/chrome/browser/search_engines/template_url_service_unittest.cc b/chrome/browser/search_engines/template_url_service_unittest.cc
index 564dd2ad902db81f9918f826c0941ce5444feff9..1d09327caef9cca530ea20073e30cc4b9d3713ba 100644
--- a/chrome/browser/search_engines/template_url_service_unittest.cc
+++ b/chrome/browser/search_engines/template_url_service_unittest.cc
@@ -1793,6 +1793,29 @@ TEST_F(TemplateURLServiceTest, CheckNonreplaceableEnginesKeywordsConflicts) {
EXPECT_EQ(kCommonKeyword, user4->keyword());
EXPECT_EQ(user4, model()->GetTemplateURLForKeyword(kCommonKeyword));
EXPECT_EQ(user4, model()->GetTemplateURLForHost("test3"));
+
+ // Check conflict between search engines with html tags embedded in URL host.
+ // URLs with embedded HTML canonicalize to contain uppercase characters in the
+ // hostname. Ensure these URLs are still handled correctly for conflict
+ // resolution.
+ const TemplateURL* user5 =
+ AddKeywordWithDate("nonreplaceable5", "embedded.%3chtml%3eweb",
+ "http://embedded.<html>web/?q={searchTerms}",
+ std::string(), std::string(), std::string(), false);
+ EXPECT_EQ(ASCIIToUTF16("embedded.%3chtml%3eweb"), user5->keyword());
+ EXPECT_EQ(user5, model()->GetTemplateURLForKeyword(
+ ASCIIToUTF16("embedded.%3chtml%3eweb")));
+ const TemplateURL* user6 =
+ AddKeywordWithDate("nonreplaceable6", "embedded.%3chtml%3eweb",
+ "http://embedded.<html>web/?q={searchTerms}",
+ std::string(), std::string(), std::string(), false);
+ EXPECT_EQ(ASCIIToUTF16("embedded.%3chtml%3eweb"), user6->keyword());
+ EXPECT_EQ(user6, model()->GetTemplateURLForKeyword(
+ ASCIIToUTF16("embedded.%3chtml%3eweb")));
+ // Expect existing engine changed its keyword.
+ EXPECT_EQ(ASCIIToUTF16("embedded.%3chtml%3eweb_"), user5->keyword());
+ EXPECT_EQ(user5, model()->GetTemplateURLForKeyword(
+ ASCIIToUTF16("embedded.%3chtml%3eweb_")));
}
TEST_F(TemplateURLServiceTest, CheckReplaceableEnginesKeywordsConflicts) {
« no previous file with comments | « no previous file | components/search_engines/template_url.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698