From be84707cb121f358caae21fa17efbd70d2a94280 Mon Sep 17 00:00:00 2001 From: Rustam Vishnyakov Date: Mon, 7 Aug 2017 17:21:02 +0300 Subject: [PATCH] Reuse utility methods from FontPreferencesTest and use only actually available fonts in tests to prevent a fallback to default font. --- .../colors/impl/EditorColorsSchemeImplTest.java | 10 +++------- .../editor/impl/EditorColorsSchemeDelegateTest.java | 12 ++++++------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/colors/impl/EditorColorsSchemeImplTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/colors/impl/EditorColorsSchemeImplTest.java index acd6aff98360..21b1d14331eb 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/colors/impl/EditorColorsSchemeImplTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/colors/impl/EditorColorsSchemeImplTest.java @@ -432,10 +432,8 @@ public class EditorColorsSchemeImplTest extends EditorColorSchemeTestCase { } public void testReadFontPreferences() throws Exception { - String[] fontFamilyNames = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames(); - if (fontFamilyNames.length < 2) return; - String name1 = fontFamilyNames[0]; - String name2 = fontFamilyNames[1]; + String name1 = getExistingNonDefaultFontName(); + String name2 = getAnotherExistingNonDefaultFontName(); EditorColorsScheme scheme = loadScheme( "\n" + "