OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "Resources.h" | 8 #include "Resources.h" |
9 #include "SkEndian.h" | 9 #include "SkEndian.h" |
10 #include "SkFontStream.h" | 10 #include "SkFontStream.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 } | 148 } |
149 } | 149 } |
150 | 150 |
151 static void test_fontstream(skiatest::Reporter* reporter) { | 151 static void test_fontstream(skiatest::Reporter* reporter) { |
152 // This test cannot run if there is no resource path. | 152 // This test cannot run if there is no resource path. |
153 SkString resourcePath = GetResourcePath(); | 153 SkString resourcePath = GetResourcePath(); |
154 if (resourcePath.isEmpty()) { | 154 if (resourcePath.isEmpty()) { |
155 SkDebugf("Could not run fontstream test because resourcePath not specifi
ed."); | 155 SkDebugf("Could not run fontstream test because resourcePath not specifi
ed."); |
156 return; | 156 return; |
157 } | 157 } |
158 SkString filename = SkOSPath::SkPathJoin(resourcePath.c_str(), "test.ttc"); | 158 SkString filename = SkOSPath::Join(resourcePath.c_str(), "test.ttc"); |
159 | 159 |
160 SkFILEStream stream(filename.c_str()); | 160 SkFILEStream stream(filename.c_str()); |
161 if (stream.isValid()) { | 161 if (stream.isValid()) { |
162 test_fontstream(reporter, &stream); | 162 test_fontstream(reporter, &stream); |
163 } else { | 163 } else { |
164 SkDebugf("Could not run fontstream test because test.ttc not found."); | 164 SkDebugf("Could not run fontstream test because test.ttc not found."); |
165 } | 165 } |
166 } | 166 } |
167 | 167 |
168 static void test_tables(skiatest::Reporter* reporter, SkTypeface* face) { | 168 static void test_tables(skiatest::Reporter* reporter, SkTypeface* face) { |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 } | 300 } |
301 } | 301 } |
302 | 302 |
303 DEF_TEST(FontHost, reporter) { | 303 DEF_TEST(FontHost, reporter) { |
304 test_tables(reporter); | 304 test_tables(reporter); |
305 test_fontstream(reporter); | 305 test_fontstream(reporter); |
306 test_advances(reporter); | 306 test_advances(reporter); |
307 } | 307 } |
308 | 308 |
309 // need tests for SkStrSearch | 309 // need tests for SkStrSearch |
OLD | NEW |