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

Unified Diff: tests/FontHostTest.cpp

Issue 1120823002: Move resource fonts to common location. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove now unused variable. Created 5 years, 8 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 | « resources/test.ttc ('k') | tests/SerializationTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/FontHostTest.cpp
diff --git a/tests/FontHostTest.cpp b/tests/FontHostTest.cpp
index 249fe7b1fb054f9e41d9619f17200aa2dca22deb..ff275e2ad5ddbc83f6d80846985f35d281a181cb 100644
--- a/tests/FontHostTest.cpp
+++ b/tests/FontHostTest.cpp
@@ -111,8 +111,7 @@ static void test_charsToGlyphs(skiatest::Reporter* reporter, SkTypeface* face) {
}
}
-static void test_fontstream(skiatest::Reporter* reporter,
- SkStream* stream, int ttcIndex) {
+static void test_fontstream(skiatest::Reporter* reporter, SkStream* stream, int ttcIndex) {
int n = SkFontStream::GetTableTags(stream, ttcIndex, NULL);
SkAutoTArray<SkFontTableTag> array(n);
@@ -138,7 +137,13 @@ static void test_fontstream(skiatest::Reporter* reporter,
}
}
-static void test_fontstream(skiatest::Reporter* reporter, SkStream* stream) {
+static void test_fontstream(skiatest::Reporter* reporter) {
+ SkAutoTDelete<SkStreamAsset> stream(GetResourceAsStream("/fonts/test.ttc"));
+ if (!stream) {
+ SkDebugf("Skipping FontHostTest::test_fontstream\n");
+ return;
+ }
+
int count = SkFontStream::CountTTCEntries(stream);
#ifdef DUMP_TTC_TABLES
SkDebugf("CountTTCEntries %d\n", count);
@@ -148,23 +153,6 @@ static void test_fontstream(skiatest::Reporter* reporter, SkStream* stream) {
}
}
-static void test_fontstream(skiatest::Reporter* reporter) {
- // This test cannot run if there is no resource path.
- SkString resourcePath = GetResourcePath();
- if (resourcePath.isEmpty()) {
- SkDebugf("Could not run fontstream test because resourcePath not specified.");
- return;
- }
- SkString filename = SkOSPath::Join(resourcePath.c_str(), "test.ttc");
-
- SkFILEStream stream(filename.c_str());
- if (stream.isValid()) {
- test_fontstream(reporter, &stream);
- } else {
- SkDebugf("Could not run fontstream test because test.ttc not found.");
- }
-}
-
static void test_tables(skiatest::Reporter* reporter, SkTypeface* face) {
if (false) { // avoid bit rot, suppress warning
SkFontID fontID = face->uniqueID();
« no previous file with comments | « resources/test.ttc ('k') | tests/SerializationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698