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

Side by Side Diff: tests/FontHostTest.cpp

Issue 346453002: Refactor how we handle resources path in Tests. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix rebase conflict Created 6 years, 6 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 unified diff | Download patch
« no previous file with comments | « samplecode/SampleUnpremul.cpp ('k') | tests/ImageDecodingTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "SkEndian.h" 9 #include "SkEndian.h"
9 #include "SkFontStream.h" 10 #include "SkFontStream.h"
10 #include "SkOSFile.h" 11 #include "SkOSFile.h"
11 #include "SkPaint.h" 12 #include "SkPaint.h"
12 #include "SkStream.h" 13 #include "SkStream.h"
13 #include "SkTypeface.h" 14 #include "SkTypeface.h"
14 #include "Test.h" 15 #include "Test.h"
15 16
16 //#define DUMP_TABLES 17 //#define DUMP_TABLES
17 //#define DUMP_TTC_TABLES 18 //#define DUMP_TTC_TABLES
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 #ifdef DUMP_TTC_TABLES 143 #ifdef DUMP_TTC_TABLES
143 SkDebugf("CountTTCEntries %d\n", count); 144 SkDebugf("CountTTCEntries %d\n", count);
144 #endif 145 #endif
145 for (int i = 0; i < count; ++i) { 146 for (int i = 0; i < count; ++i) {
146 test_fontstream(reporter, stream, i); 147 test_fontstream(reporter, stream, i);
147 } 148 }
148 } 149 }
149 150
150 static void test_fontstream(skiatest::Reporter* reporter) { 151 static void test_fontstream(skiatest::Reporter* reporter) {
151 // This test cannot run if there is no resource path. 152 // This test cannot run if there is no resource path.
152 SkString resourcePath = skiatest::Test::GetResourcePath(); 153 SkString resourcePath = GetResourcePath();
153 if (resourcePath.isEmpty()) { 154 if (resourcePath.isEmpty()) {
154 SkDebugf("Could not run fontstream test because resourcePath not specifi ed."); 155 SkDebugf("Could not run fontstream test because resourcePath not specifi ed.");
155 return; 156 return;
156 } 157 }
157 SkString filename = SkOSPath::SkPathJoin(resourcePath.c_str(), "test.ttc"); 158 SkString filename = SkOSPath::SkPathJoin(resourcePath.c_str(), "test.ttc");
158 159
159 SkFILEStream stream(filename.c_str()); 160 SkFILEStream stream(filename.c_str());
160 if (stream.isValid()) { 161 if (stream.isValid()) {
161 test_fontstream(reporter, &stream); 162 test_fontstream(reporter, &stream);
162 } else { 163 } else {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 } 300 }
300 } 301 }
301 302
302 DEF_TEST(FontHost, reporter) { 303 DEF_TEST(FontHost, reporter) {
303 test_tables(reporter); 304 test_tables(reporter);
304 test_fontstream(reporter); 305 test_fontstream(reporter);
305 test_advances(reporter); 306 test_advances(reporter);
306 } 307 }
307 308
308 // need tests for SkStrSearch 309 // need tests for SkStrSearch
OLDNEW
« no previous file with comments | « samplecode/SampleUnpremul.cpp ('k') | tests/ImageDecodingTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698