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

Commit e2571e65 authored by Mihai Popa's avatar Mihai Popa
Browse files

Fix TypefaceTest#testMultithreadCacheStressTest

The CL fixes test TypefaceTest#testMultithreadCacheStressTest,
previously broken in ag/3057624.

Bug: 68384363
Test: bit FrameworksCoreTests:android.graphics.TypefaceTest &&
bit FrameworksCoreTests:android.graphics.FontResourcesParserTest &&
bit FrameworksCoreTests:android.graphics.TypefaceTest

Change-Id: I3f3d9c287888ea034454d0d0a0020c1778a2121b
parent 426dd380
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:android="http://schemas.android.com/apk/res/android">
    <font android:fontStyle="normal" android:fontWeight="400" android:fontVariationSettings="'wdth' 0.8"
          android:font="@font/samplefont" android:ttcIndex="0"/>
    <font android:fontStyle="italic" android:fontWeight="400" android:fontVariationSettings="'contrast' 0.5"
          android:font="@font/samplefont2" android:ttcIndex="1" />
    <font android:fontStyle="normal" android:fontWeight="800" android:fontVariationSettings="'wdth' 500.0, 'wght' 300.0"
          android:font="@font/samplefont3" android:ttcIndex="2" />
    <font android:fontStyle="normal" android:fontWeight="400" android:font="@font/samplefont" />
    <font android:fontStyle="italic" android:fontWeight="400" android:font="@font/samplefont2" />
    <font android:fontStyle="normal" android:fontWeight="800" android:font="@font/samplefont3" />
    <font android:fontStyle="italic" android:fontWeight="800" android:font="@font/samplefont4" />
</font-family>
+10 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:android="http://schemas.android.com/apk/res/android">
    <font android:fontStyle="normal" android:fontWeight="400" android:fontVariationSettings="'wdth' 0.8"
          android:font="@font/samplefont" android:ttcIndex="0" />
    <font android:fontStyle="italic" android:fontWeight="400" android:fontVariationSettings="'cntr' 0.5"
          android:font="@font/samplefont2" android:ttcIndex="1" />
    <font android:fontStyle="normal" android:fontWeight="800" android:fontVariationSettings="'wdth' 500.0, 'wght' 300.0"
          android:font="@font/samplefont3" android:ttcIndex="2" />
    <font android:fontStyle="italic" android:fontWeight="800" android:font="@font/samplefont4" />
</font-family>
+2 −2
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ public class FontResourcesParserTest {

    @Test
    public void testParse() throws XmlPullParserException, IOException {
        XmlResourceParser parser = mResources.getXml(R.font.samplexmlfont);
        XmlResourceParser parser = mResources.getXml(R.font.samplexmlfontforparsing);

        FamilyResourceEntry result = FontResourcesParser.parse(parser, mResources);

@@ -76,7 +76,7 @@ public class FontResourcesParserTest {
        assertEquals(400, font2.getWeight());
        assertEquals(1, font2.getItalic());
        assertEquals(1, font2.getTtcIndex());
        assertEquals("'contrast' 0.5", font2.getVariationSettings());
        assertEquals("'cntr' 0.5", font2.getVariationSettings());
        assertEquals("res/font/samplefont2.ttf", font2.getFileName());
        FontFileResourceEntry font3 = fileEntries[2];
        assertEquals(800, font3.getWeight());