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

Unified Diff: tests/FontConfigParser.cpp

Issue 451703004: Don't fail unit test if resources not found on device. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 months 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 | « no previous file | 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 73e9d2bf65e07bae7fc81aeec6f31ff58a68884d..1c32704938d69ab723b204d28673537108cb9dff 100644
--- a/tests/FontConfigParser.cpp
+++ b/tests/FontConfigParser.cpp
@@ -50,15 +50,21 @@ void DumpLoadedFonts(SkTDArray<FontFamily*> fontFamilies) {
DEF_TEST(FontConfigParserAndroid, reporter) {
+ bool resourcesMissing = false;
+
SkTDArray<FontFamily*> preV17FontFamilies;
SkFontConfigParser::GetTestFontFamilies(preV17FontFamilies,
GetResourcePath("android_fonts/pre_v17/system_fonts.xml").c_str(),
GetResourcePath("android_fonts/pre_v17/fallback_fonts.xml").c_str());
- REPORTER_ASSERT(reporter, preV17FontFamilies.count() == 14);
+ if (preV17FontFamilies.count() > 0) {
+ REPORTER_ASSERT(reporter, preV17FontFamilies.count() == 14);
- DumpLoadedFonts(preV17FontFamilies);
- ValidateLoadedFonts(preV17FontFamilies, reporter);
+ DumpLoadedFonts(preV17FontFamilies);
+ ValidateLoadedFonts(preV17FontFamilies, reporter);
+ } else {
+ resourcesMissing = true;
+ }
SkTDArray<FontFamily*> v17FontFamilies;
@@ -66,10 +72,14 @@ DEF_TEST(FontConfigParserAndroid, reporter) {
GetResourcePath("android_fonts/v17/system_fonts.xml").c_str(),
GetResourcePath("android_fonts/v17/fallback_fonts.xml").c_str());
- REPORTER_ASSERT(reporter, v17FontFamilies.count() == 41);
+ if (v17FontFamilies.count() > 0) {
+ REPORTER_ASSERT(reporter, v17FontFamilies.count() == 41);
- DumpLoadedFonts(v17FontFamilies);
- ValidateLoadedFonts(v17FontFamilies, reporter);
+ DumpLoadedFonts(v17FontFamilies);
+ ValidateLoadedFonts(v17FontFamilies, reporter);
+ } else {
+ resourcesMissing = true;
+ }
SkTDArray<FontFamily*> v22FontFamilies;
@@ -77,9 +87,17 @@ DEF_TEST(FontConfigParserAndroid, reporter) {
GetResourcePath("android_fonts/v22/fonts.xml").c_str(),
NULL);
- REPORTER_ASSERT(reporter, v22FontFamilies.count() == 53);
+ if (v22FontFamilies.count() > 0) {
+ REPORTER_ASSERT(reporter, v22FontFamilies.count() == 53);
- DumpLoadedFonts(v22FontFamilies);
- ValidateLoadedFonts(v22FontFamilies, reporter);
+ DumpLoadedFonts(v22FontFamilies);
+ ValidateLoadedFonts(v22FontFamilies, reporter);
+ } else {
+ resourcesMissing = true;
+ }
+
+ if (resourcesMissing) {
+ SkDebugf("---- Resource files missing for FontConfigParser test\n");
+ }
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698