| Index: chrome/browser/android/vr_shell/textures/url_bar_texture_unittest.cc
|
| diff --git a/chrome/browser/android/vr_shell/textures/url_bar_texture_unittest.cc b/chrome/browser/android/vr_shell/textures/url_bar_texture_unittest.cc
|
| index f6e2cc5c4e0d67f8c2c1e82a65297e0322c788f7..a7e7b726ec32e6d97f5c84599611228e3e25a348 100644
|
| --- a/chrome/browser/android/vr_shell/textures/url_bar_texture_unittest.cc
|
| +++ b/chrome/browser/android/vr_shell/textures/url_bar_texture_unittest.cc
|
| @@ -54,6 +54,19 @@ class TestUrlBarTexture : public UrlBarTexture {
|
| SetForceFontFallbackFailureForTesting(force);
|
| }
|
|
|
| + size_t GetNumberOfFontFallbacksForURL(const GURL& gurl) {
|
| + url::Parsed parsed;
|
| + const base::string16 text = url_formatter::FormatUrl(
|
| + gurl, url_formatter::kFormatUrlOmitAll, net::UnescapeRule::NORMAL,
|
| + &parsed, nullptr, nullptr);
|
| +
|
| + gfx::FontList font_list;
|
| + if (!GetFontList(kUrlHeight, text, &font_list))
|
| + return 0;
|
| +
|
| + return font_list.GetFonts().size();
|
| + }
|
| +
|
| // Reports the last unsupported mode that was encountered. Returns kCount if
|
| // no unsupported mode was encountered.
|
| UiUnsupportedMode unsupported_mode() const { return unsupported_mode_; }
|
| @@ -114,6 +127,12 @@ class UrlEmphasisTest : public testing::Test {
|
| MockRenderText mock_;
|
| };
|
|
|
| +TEST(UrlBarTextureTest, WillNotFailOnNonAsciiURLs) {
|
| + TestUrlBarTexture texture;
|
| + EXPECT_EQ(3lu, texture.GetNumberOfFontFallbacksForURL(
|
| + GURL("http://中央大学.ಠ_ಠ.tw/")));
|
| +}
|
| +
|
| TEST_F(UrlEmphasisTest, SecureHttpsHost) {
|
| EXPECT_CALL(mock_, SetColor(kDeemphasizedColor));
|
| EXPECT_CALL(mock_, ApplyColor(kEmphasizedColor, gfx::Range(8, 16)));
|
|
|