diff options
author | Ben Wagner <bungeman@google.com> | 2017-08-10 13:49:41 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-08-14 19:29:05 +0000 |
commit | aee878d767a3965ee6409be9c72bb9ae6266bf52 (patch) | |
tree | c6f6e2cb26e624db3ab63cb9ecdfccaccd2869d1 /tests/FontMgrAndroidParserTest.cpp | |
parent | df33fefe14837d7a7130aacb6206dbe3ebc7d081 (diff) |
Move lang to list in Android font manager.
Change-Id: Ia4af2769f4761e6b444ed0c232c48199872f3acc
Reviewed-on: https://skia-review.googlesource.com/33480
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'tests/FontMgrAndroidParserTest.cpp')
-rw-r--r-- | tests/FontMgrAndroidParserTest.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/tests/FontMgrAndroidParserTest.cpp b/tests/FontMgrAndroidParserTest.cpp index cbcfb3be2a..b5346ef5b6 100644 --- a/tests/FontMgrAndroidParserTest.cpp +++ b/tests/FontMgrAndroidParserTest.cpp @@ -45,11 +45,13 @@ void ValidateLoadedFonts(SkTDArray<FontFamily*> fontFamilies, const char* firstE REPORTER_ASSERT(reporter, !fontFamilies[0]->fIsFallbackFont); // Check that the languages are all sane. - for (int i = 0; i < fontFamilies.count(); ++i) { - const SkString& lang = fontFamilies[i]->fLanguage.getTag(); - for (size_t j = 0; j < lang.size(); ++j) { - int c = lang[j]; - REPORTER_ASSERT(reporter, isALPHA(c) || isDIGIT(c) || '-' == c); + for (const auto& fontFamily : fontFamilies) { + for (const auto& lang : fontFamily->fLanguages) { + const SkString& langString = lang.getTag(); + for (size_t i = 0; i < langString.size(); ++i) { + int c = langString[i]; + REPORTER_ASSERT(reporter, isALPHA(c) || isDIGIT(c) || '-' == c); + } } } @@ -81,8 +83,12 @@ void DumpLoadedFonts(SkTDArray<FontFamily*> fontFamilies, const char* label) { default: break; } SkDebugf(" basePath %s\n", fontFamilies[i]->fBasePath.c_str()); - if (!fontFamilies[i]->fLanguage.getTag().isEmpty()) { - SkDebugf(" language %s\n", fontFamilies[i]->fLanguage.getTag().c_str()); + if (!fontFamilies[i]->fLanguages.empty()) { + SkDebugf(" language"); + for (const auto& lang : fontFamilies[i]->fLanguages) { + SkDebugf(" %s", lang.getTag().c_str()); + } + SkDebugf("\n"); } for (int j = 0; j < fontFamilies[i]->fNames.count(); ++j) { SkDebugf(" name %s\n", fontFamilies[i]->fNames[j].c_str()); |