Merge "Fix TypefaceTest#testMultithreadCacheStressTest"
This commit is contained in:
committed by
Android (Google) Code Review
commit
411609ab74
@@ -1,10 +1,7 @@
|
||||
<?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
core/tests/coretests/res/font/samplexmlfontforparsing.xml
Normal file
10
core/tests/coretests/res/font/samplexmlfontforparsing.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?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>
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user