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

Unified Diff: components/search_engines/template_url_unittest.cc

Issue 1238683003: Unpunycode search keywords and short names. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Fix grammar. Created 5 years, 5 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: components/search_engines/template_url_unittest.cc
diff --git a/components/search_engines/template_url_unittest.cc b/components/search_engines/template_url_unittest.cc
index b905ded6d6086c7a419d1fcd2225e194f7d2758a..2c941f7ed51e07213c8a94c6551398477cc40894 100644
--- a/components/search_engines/template_url_unittest.cc
+++ b/components/search_engines/template_url_unittest.cc
@@ -1694,17 +1694,21 @@ TEST_F(TemplateURLTest, ContextualSearchParameters) {
}
TEST_F(TemplateURLTest, GenerateKeyword) {
+ std::string accept_languages = "en,ru";
ASSERT_EQ(ASCIIToUTF16("foo"),
- TemplateURL::GenerateKeyword(GURL("http://foo")));
+ TemplateURL::GenerateKeyword(GURL("http://foo"), accept_languages));
// www. should be stripped.
- ASSERT_EQ(ASCIIToUTF16("foo"),
- TemplateURL::GenerateKeyword(GURL("http://www.foo")));
+ ASSERT_EQ(ASCIIToUTF16("foo"), TemplateURL::GenerateKeyword(
+ GURL("http://www.foo"), accept_languages));
// Make sure we don't get a trailing '/'.
- ASSERT_EQ(ASCIIToUTF16("blah"),
- TemplateURL::GenerateKeyword(GURL("http://blah/")));
+ ASSERT_EQ(ASCIIToUTF16("blah"), TemplateURL::GenerateKeyword(
+ GURL("http://blah/"), accept_languages));
// Don't generate the empty string.
- ASSERT_EQ(ASCIIToUTF16("www"),
- TemplateURL::GenerateKeyword(GURL("http://www.")));
+ ASSERT_EQ(ASCIIToUTF16("www"), TemplateURL::GenerateKeyword(
+ GURL("http://www."), accept_languages));
+ ASSERT_EQ(
+ base::UTF8ToUTF16("\xd0\xb0\xd0\xb1\xd0\xb2"),
+ TemplateURL::GenerateKeyword(GURL("http://xn--80acd"), accept_languages));
}
TEST_F(TemplateURLTest, GenerateSearchURL) {
« no previous file with comments | « components/search_engines/template_url_service.cc ('k') | components/test/data/search_engines/unicode_open_search.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698