Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db211314 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix UpdatableFontDirTest" into main

parents e17ff605 c84bcef0
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -234,6 +234,22 @@ public final class SystemFonts {
                updatableFontMap, lastModifiedDate, configVersion);
    }

    /**
     * Get the updated FontConfig.
     *
     * @param updatableFontMap a font mapping of updated font files.
     * @hide
     */
    public static @NonNull FontConfig getSystemFontConfigForTesting(
            @NonNull String fontsXml,
            @Nullable Map<String, File> updatableFontMap,
            long lastModifiedDate,
            int configVersion
    ) {
        return getSystemFontConfigInternal(fontsXml, SYSTEM_FONT_DIR, OEM_XML, OEM_FONT_DIR,
                updatableFontMap, lastModifiedDate, configVersion);
    }

    /**
     * Get the system preinstalled FontConfig.
     * @hide
+3 −1
Original line number Diff line number Diff line
@@ -67,6 +67,8 @@ import java.util.stream.Collectors;
@RunWith(AndroidJUnit4.class)
public final class UpdatableFontDirTest {

    private static final String LEGACY_FONTS_XML = "/system/etc/fonts.xml";

    /**
     * A {@link UpdatableFontDir.FontFileParser} for testing. Instead of using real font files,
     * this test uses fake font files. A fake font file has its PostScript naem and revision as the
@@ -140,7 +142,7 @@ public final class UpdatableFontDirTest {
    private List<File> mPreinstalledFontDirs;
    private final Supplier<Long> mCurrentTimeSupplier = () -> CURRENT_TIME;
    private final Function<Map<String, File>, FontConfig> mConfigSupplier =
            (map) -> SystemFonts.getSystemFontConfig(map, 0, 0);
            (map) -> SystemFonts.getSystemFontConfigForTesting(LEGACY_FONTS_XML, map, 0, 0);
    private FakeFontFileParser mParser;
    private FakeFsverityUtil mFakeFsverityUtil;