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

Unified Diff: components/omnibox/browser/history_url_provider_unittest.cc

Issue 1258813002: Implement a new IDN display policy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: url_canon test: wchar* needs a surrogate pair on *nix Created 4 years, 9 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/url_formatter/url_formatter.h » ('j') | components/url_formatter/url_formatter.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/omnibox/browser/history_url_provider_unittest.cc
diff --git a/components/omnibox/browser/history_url_provider_unittest.cc b/components/omnibox/browser/history_url_provider_unittest.cc
index 8dcb8d66adc9ec40f971bf73f306a4d32294e67a..93c316be986bfd37a4c74dc572f1a579294ab367 100644
--- a/components/omnibox/browser/history_url_provider_unittest.cc
+++ b/components/omnibox/browser/history_url_provider_unittest.cc
@@ -852,8 +852,10 @@ TEST_F(HistoryURLProviderTest, DoesNotProvideMatchesOnFocus) {
TEST_F(HistoryURLProviderTest, DoesNotInlinePunycodeMatches) {
// A URL that matches due to a match in the punycode URL are allowed to be the
- // default match if the URL doesn't get rendered as international characters
- // in the given locale.
+ // default match if the URL doesn't get rendered as international characters.
+ // When the punycode part of the URL is rendered as international characters,
+ // this match should not be allowed to be the default match if the inline
+ // autocomplete text starts in the middle of the international characters.
const UrlAndLegalDefault expected_true[] = {
{ "http://puny.xn--1lq90ic7f1rc.cn/", true },
};
@@ -864,28 +866,6 @@ TEST_F(HistoryURLProviderTest, DoesNotInlinePunycodeMatches) {
arraysize(expected_true));
RunTest(ASCIIToUTF16("puny."), std::string(), false, expected_true,
arraysize(expected_true));
- RunTest(ASCIIToUTF16("puny.x"), std::string(), false, expected_true,
- arraysize(expected_true));
- RunTest(ASCIIToUTF16("puny.xn"), std::string(), false, expected_true,
- arraysize(expected_true));
- RunTest(ASCIIToUTF16("puny.xn--"), std::string(), false, expected_true,
- arraysize(expected_true));
- RunTest(ASCIIToUTF16("puny.xn--1l"), std::string(), false, expected_true,
- arraysize(expected_true));
- RunTest(ASCIIToUTF16("puny.xn--1lq90ic7f1rc"), std::string(), false,
- expected_true, arraysize(expected_true));
- RunTest(ASCIIToUTF16("puny.xn--1lq90ic7f1rc."), std::string(), false,
- expected_true, arraysize(expected_true));
- // Set the language so the punycode part of the URL is rendered as
- // international characters. Then this match should not be allowed to be
- // the default match if the inline autocomplete text starts in the middle
- // of the international characters.
- EXPECT_CALL(*client_, GetAcceptLanguages())
- .WillRepeatedly(testing::Return("zh-CN"));
- RunTest(ASCIIToUTF16("pun"), std::string(), false, expected_true,
- arraysize(expected_true));
- RunTest(ASCIIToUTF16("puny."), std::string(), false, expected_true,
- arraysize(expected_true));
RunTest(ASCIIToUTF16("puny.x"), std::string(), false, expected_false,
arraysize(expected_false));
RunTest(ASCIIToUTF16("puny.xn"), std::string(), false, expected_false,
« no previous file with comments | « no previous file | components/url_formatter/url_formatter.h » ('j') | components/url_formatter/url_formatter.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698