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

Unified Diff: components/url_formatter/elide_url_unittest.cc

Issue 1841653003: Drop |languages| from {Format,Elide}Url* and IDNToUnicode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo in elide_url.cc Created 4 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 | « components/url_formatter/elide_url.cc ('k') | components/url_formatter/url_fixer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/url_formatter/elide_url_unittest.cc
diff --git a/components/url_formatter/elide_url_unittest.cc b/components/url_formatter/elide_url_unittest.cc
index ede2bf6eea7eaaf05d20b05bc147bc520b06590a..1d911a8e216eb55438fb464eea1791380477052e 100644
--- a/components/url_formatter/elide_url_unittest.cc
+++ b/components/url_formatter/elide_url_unittest.cc
@@ -36,13 +36,10 @@ void RunUrlTest(Testcase* testcases, size_t num_testcases) {
static const gfx::FontList font_list;
for (size_t i = 0; i < num_testcases; ++i) {
const GURL url(testcases[i].input);
- // Should we test with non-empty language list?
- // That's kinda redundant with net_util_unittests.
const float available_width =
gfx::GetStringWidthF(base::UTF8ToUTF16(testcases[i].output), font_list);
EXPECT_EQ(base::UTF8ToUTF16(testcases[i].output),
- url_formatter::ElideUrl(url, font_list, available_width,
- std::string()));
+ url_formatter::ElideUrl(url, font_list, available_width));
}
}
@@ -95,11 +92,10 @@ TEST(TextEliderTest, TestTrailingEllipsisSlashEllipsisHack) {
gfx::GetStringWidthF(base::UTF8ToUTF16("d" + kEllipsisStr), font_list));
GURL long_url("http://battersbox.com/directorynameisreallylongtoforcetrunc");
base::string16 expected = url_formatter::ElideUrl(
- long_url, font_list, available_width, std::string());
+ long_url, font_list, available_width);
// Ensure that the expected result still contains part of the directory name.
ASSERT_GT(expected.length(), std::string("battersbox.com/d").length());
- EXPECT_EQ(expected, url_formatter::ElideUrl(url, font_list, available_width,
- std::string()));
+ EXPECT_EQ(expected, url_formatter::ElideUrl(url, font_list, available_width));
// More space available - elide directories, partially elide filename.
Testcase testcases[] = {
@@ -327,42 +323,27 @@ TEST(TextEliderTest, FormatUrlForSecurityDisplay) {
L"blob:http%3A//www.html5rocks.com/"
L"4d4ff040-6d61-4446-86d3-13ca07ec9ab9"}};
- const char languages[] = "zh-TW,en-US,en,am,ar-EG,ar";
for (size_t i = 0; i < arraysize(tests); ++i) {
- base::string16 formatted = url_formatter::FormatUrlForSecurityDisplay(
- GURL(tests[i].input), std::string());
+ base::string16 formatted =
+ url_formatter::FormatUrlForSecurityDisplay(GURL(tests[i].input));
EXPECT_EQ(base::WideToUTF16(tests[i].output), formatted)
<< tests[i].description;
base::string16 formatted_omit_scheme =
url_formatter::FormatUrlForSecurityDisplayOmitScheme(
- GURL(tests[i].input), std::string());
+ GURL(tests[i].input));
EXPECT_EQ(base::WideToUTF16(tests[i].output_omit_scheme),
formatted_omit_scheme)
<< tests[i].description;
-
- base::string16 formatted_with_languages =
- url_formatter::FormatUrlForSecurityDisplay(GURL(tests[i].input),
- languages);
- EXPECT_EQ(base::WideToUTF16(tests[i].output), formatted_with_languages)
- << tests[i].description;
-
- base::string16 formatted_with_languages_omit_scheme =
- url_formatter::FormatUrlForSecurityDisplayOmitScheme(
- GURL(tests[i].input), languages);
- EXPECT_EQ(base::WideToUTF16(tests[i].output_omit_scheme),
- formatted_with_languages_omit_scheme)
- << tests[i].description;
}
base::string16 formatted =
- url_formatter::FormatUrlForSecurityDisplay(GURL(), std::string());
+ url_formatter::FormatUrlForSecurityDisplay(GURL());
EXPECT_EQ(base::string16(), formatted)
<< "Explicitly test the 0-argument GURL constructor";
base::string16 formatted_omit_scheme =
- url_formatter::FormatUrlForSecurityDisplayOmitScheme(GURL(),
- std::string());
+ url_formatter::FormatUrlForSecurityDisplayOmitScheme(GURL());
EXPECT_EQ(base::string16(), formatted_omit_scheme)
<< "Explicitly test the 0-argument GURL constructor";
}
« no previous file with comments | « components/url_formatter/elide_url.cc ('k') | components/url_formatter/url_fixer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698