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

Unified Diff: chrome/browser/android/vr_shell/textures/url_bar_texture_unittest.cc

Issue 2926303003: [vr] Fix incorrect negation in font fallback logic. (Closed)
Patch Set: Created 3 years, 6 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 | « chrome/browser/android/vr_shell/textures/ui_texture.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)));
« no previous file with comments | « chrome/browser/android/vr_shell/textures/ui_texture.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698