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

Unified Diff: components/search_engines/template_url_unittest.cc

Issue 2397873002: Reject some previuosly-escaped chars in hostnames.
Patch Set: Some tests fixed Created 4 years, 1 month 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 de0a54a263f88f2cf3aedff74ed479c3abead19e..6c6bf0e63210cccc5a0af3df62d8896aae97d89f 100644
--- a/components/search_engines/template_url_unittest.cc
+++ b/components/search_engines/template_url_unittest.cc
@@ -72,10 +72,10 @@ TEST_F(TemplateURLTest, URLRefTestSearchTerms) {
const base::string16 terms;
const std::string output;
} search_term_cases[] = {
- { "http://foo{searchTerms}", ASCIIToUTF16("sea rch/bar"),
- "http://foosea%20rch/bar" },
- { "http://foo{searchTerms}?boo=abc", ASCIIToUTF16("sea rch/bar"),
- "http://foosea%20rch/bar?boo=abc" },
+ { "http://foo{searchTerms}", ASCIIToUTF16("search/bar"),
+ "http://foosearch/bar" },
+ { "http://foo{searchTerms}?boo=abc", ASCIIToUTF16("search/bar"),
+ "http://foosearch/bar?boo=abc" },
{ "http://foo/?boo={searchTerms}", ASCIIToUTF16("sea rch/bar"),
"http://foo/?boo=sea+rch%2Fbar" },
{ "http://en.wikipedia.org/{searchTerms}", ASCIIToUTF16("wiki/?"),
@@ -294,13 +294,13 @@ TEST_F(TemplateURLTest, SetPrepopulatedAndReplace) {
const SearchTermsData& stdata = search_terms_data_;
TemplateURL url(data);
- EXPECT_EQ("http://foo%7Bfhqwhgads%7Dsearch/?q=X",
+ EXPECT_EQ("http://foo{fhqwhgads}search/?q=X",
url.url_ref().ReplaceSearchTerms(args, stdata));
- EXPECT_EQ("http://foo%7Bfhqwhgads%7Dalternate/?q=X",
+ EXPECT_EQ("http://foo{fhqwhgads}alternate/?q=X",
url.url_refs()[0].ReplaceSearchTerms(args, stdata));
- EXPECT_EQ("http://foo%7Bfhqwhgads%7Dsearch/?q=X",
+ EXPECT_EQ("http://foo{fhqwhgads}search/?q=X",
url.url_refs()[1].ReplaceSearchTerms(args, stdata));
- EXPECT_EQ("http://foo%7Bfhqwhgads%7Dsuggest/?q=X",
+ EXPECT_EQ("http://foo{fhqwhgads}suggest/?q=X",
url.suggestions_url_ref().ReplaceSearchTerms(args, stdata));
EXPECT_EQ("http://foo{fhqwhgads}instant/",
url.instant_url_ref().ReplaceSearchTerms(args, stdata));
« no previous file with comments | « components/safe_browsing_db/v4_protocol_manager_util_unittest.cc ('k') | content/common/database_identifier_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698