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

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: fix 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 42825579ec6cb0b68fe701de431a2c1444d5c1f7..0d776ae7edfa1c76577f9ef32328f56afc1e787e 100644
--- a/ui/gfx/render_text_unittest.cc
+++ b/ui/gfx/render_text_unittest.cc
@@ -2577,6 +2577,16 @@ 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"));
+ 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