| Index: ui/gfx/render_text_unittest.cc
|
| diff --git a/ui/gfx/render_text_unittest.cc b/ui/gfx/render_text_unittest.cc
|
| index a5656060bebbd45d4076046fc5bf9fbc43b397b9..84daa1492b5ec9760424c402642ec88094b21f33 100644
|
| --- a/ui/gfx/render_text_unittest.cc
|
| +++ b/ui/gfx/render_text_unittest.cc
|
| @@ -4349,6 +4349,22 @@ TEST_P(RenderTextHarfBuzzTest, GetSubstringBoundsMultiline) {
|
| EXPECT_EQ(expected_total_bounds, GetSelectionBoundsUnion());
|
| }
|
|
|
| +// Tests that RenderText doesn't crash even if it's passed an invalid font.
|
| +TEST_P(RenderTextTest, InvalidFont) {
|
| +// TODO(crbug.com/) This crashes with RenderTextHarfBuzz on Mac.
|
| +#if defined(OS_MACOSX)
|
| + if (GetParam() == RENDER_TEXT_HARFBUZZ)
|
| + return;
|
| +#endif
|
| + const std::string font_name = "invalid_font";
|
| + const int kFontSize = 13;
|
| + RenderText* render_text = GetRenderText();
|
| + render_text->SetFontList(FontList(Font(font_name, kFontSize)));
|
| + render_text->SetText(ASCIIToUTF16("hello"));
|
| +
|
| + DrawVisualText();
|
| +}
|
| +
|
| // Prefix for test instantiations intentionally left blank since each test
|
| // fixture class has a single parameterization.
|
| #if defined(OS_MACOSX)
|
|
|