Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Unified Diff: tests/FontConfigParser.cpp

Issue 694533006: Allow all font weights on Android and respect overrides. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add expectations. Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ports/SkFontMgr_android.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/FontConfigParser.cpp
diff --git a/tests/FontConfigParser.cpp b/tests/FontConfigParser.cpp
index 86b2b1db904aa97eaa899374b8cd772b0916b120..4273b5eeab264173367a43fd78f749d05c69bbf2 100644
--- a/tests/FontConfigParser.cpp
+++ b/tests/FontConfigParser.cpp
@@ -19,13 +19,12 @@ int CountFallbacks(SkTDArray<FontFamily*> fontFamilies) {
return countOfFallbackFonts;
}
-void ValidateLoadedFonts(SkTDArray<FontFamily*> fontFamilies,
+void ValidateLoadedFonts(SkTDArray<FontFamily*> fontFamilies, const char* firstExpectedFile,
skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, fontFamilies[0]->fNames.count() == 5);
REPORTER_ASSERT(reporter, !strcmp(fontFamilies[0]->fNames[0].c_str(), "sans-serif"));
REPORTER_ASSERT(reporter,
- !strcmp(fontFamilies[0]->fFonts[0].fFileName.c_str(),
- "Roboto-Regular.ttf"));
+ !strcmp(fontFamilies[0]->fFonts[0].fFileName.c_str(), firstExpectedFile));
REPORTER_ASSERT(reporter, !fontFamilies[0]->fIsFallbackFont);
}
@@ -71,7 +70,7 @@ DEF_TEST(FontConfigParserAndroid, reporter) {
REPORTER_ASSERT(reporter, CountFallbacks(preV17FontFamilies) == 10);
DumpLoadedFonts(preV17FontFamilies);
- ValidateLoadedFonts(preV17FontFamilies, reporter);
+ ValidateLoadedFonts(preV17FontFamilies, "Roboto-Regular.ttf", reporter);
} else {
resourcesMissing = true;
}
@@ -87,7 +86,7 @@ DEF_TEST(FontConfigParserAndroid, reporter) {
REPORTER_ASSERT(reporter, CountFallbacks(v17FontFamilies) == 31);
DumpLoadedFonts(v17FontFamilies);
- ValidateLoadedFonts(v17FontFamilies, reporter);
+ ValidateLoadedFonts(v17FontFamilies, "Roboto-Regular.ttf", reporter);
} else {
resourcesMissing = true;
}
@@ -103,7 +102,7 @@ DEF_TEST(FontConfigParserAndroid, reporter) {
REPORTER_ASSERT(reporter, CountFallbacks(v22FontFamilies) == 42);
DumpLoadedFonts(v22FontFamilies);
- ValidateLoadedFonts(v22FontFamilies, reporter);
+ ValidateLoadedFonts(v22FontFamilies, "Roboto-Thin.ttf", reporter);
} else {
resourcesMissing = true;
}
« no previous file with comments | « src/ports/SkFontMgr_android.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698