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

Unified Diff: ui/gfx/render_text_unittest.cc

Issue 993153003: Prevent infinite loop about itemizing text in RenderTextHarfBuzz. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 5 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
« ui/gfx/render_text_harfbuzz.cc ('K') | « ui/gfx/render_text_harfbuzz.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text_unittest.cc
diff --git a/ui/gfx/render_text_unittest.cc b/ui/gfx/render_text_unittest.cc
index fa544f3e1bbf8b4785b9545a59c41f236dbd9b1e..3c94fdc46c5828551b8a16f53b3035446689c121 100644
--- a/ui/gfx/render_text_unittest.cc
+++ b/ui/gfx/render_text_unittest.cc
@@ -2577,6 +2577,17 @@ TEST_F(RenderTextTest, HarfBuzz_EmptyRun) {
EXPECT_EQ(Range(0, 0), glyphs);
}
+// Ensures RenderTextHarfBuzz::ItemizeTextToRuns() does not enter into an
+// infinite loop. See crbug.com/403892.
+TEST_F(RenderTextTest, HarfBuzz_InfiniteLoop) {
+ RenderTextHarfBuzz render_text;
+ render_text.SetObscured(true);
+ render_text.SetText(UTF8ToUTF16("\xF0\x9F\x98\x81y"));
+ render_text.ApplyStyle(BOLD, true, Range(1, 3));
+ gfx::Canvas canvas;
+ render_text.Draw(&canvas);
+}
+
// Ensure a string fits in a display rect with a width equal to the string's.
TEST_F(RenderTextTest, StringFitsOwnWidth) {
scoped_ptr<RenderText> render_text(RenderText::CreateInstance());
« ui/gfx/render_text_harfbuzz.cc ('K') | « ui/gfx/render_text_harfbuzz.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698