| 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..d83fd6ca5a9f3e68b247bc64ede0f002174c29cf 100644
|
| --- a/ui/gfx/render_text_unittest.cc
|
| +++ b/ui/gfx/render_text_unittest.cc
|
| @@ -4349,6 +4349,23 @@ 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
|
| +// for crbug.com/668058.
|
| +TEST_P(RenderTextTest, InvalidFont) {
|
| +// TODO(crbug.com/699820): 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("abc"));
|
| +
|
| + DrawVisualText();
|
| +}
|
| +
|
| // Prefix for test instantiations intentionally left blank since each test
|
| // fixture class has a single parameterization.
|
| #if defined(OS_MACOSX)
|
|
|