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

Side by Side Diff: tests/Test.cpp

Issue 321723002: Reland "Clean up Test's resourcePath code." (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: ETCBitmapBench fix 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 | « tests/Test.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1
2 /* 1 /*
3 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
4 * 3 *
5 * 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
6 * found in the LICENSE file. 5 * found in the LICENSE file.
7 */ 6 */
7
8 #include "Test.h" 8 #include "Test.h"
9 9
10 #include "SkCommandLineFlags.h" 10 #include "SkCommandLineFlags.h"
11 #include "SkError.h" 11 #include "SkError.h"
12 #include "SkString.h" 12 #include "SkString.h"
13 #include "SkTArray.h" 13 #include "SkTArray.h"
14 #include "SkTime.h" 14 #include "SkTime.h"
15 15
16 #if SK_SUPPORT_GPU 16 #if SK_SUPPORT_GPU
17 #include "GrContext.h" 17 #include "GrContext.h"
(...skipping 16 matching lines...) Expand all
34 void Reporter::reportFailed(const SkString& desc) { 34 void Reporter::reportFailed(const SkString& desc) {
35 this->onReportFailed(desc); 35 this->onReportFailed(desc);
36 } 36 }
37 37
38 void Reporter::endTest(Test* test) { 38 void Reporter::endTest(Test* test) {
39 this->onEnd(test); 39 this->onEnd(test);
40 } 40 }
41 41
42 /////////////////////////////////////////////////////////////////////////////// 42 ///////////////////////////////////////////////////////////////////////////////
43 43
44 const char* Test::gResourcePath;
45
44 Test::Test() : fReporter(NULL), fPassed(true) {} 46 Test::Test() : fReporter(NULL), fPassed(true) {}
45 47
46 Test::~Test() { 48 Test::~Test() {
47 SkSafeUnref(fReporter); 49 SkSafeUnref(fReporter);
48 } 50 }
49 51
50 void Test::setReporter(Reporter* r) { 52 void Test::setReporter(Reporter* r) {
51 SkRefCnt_SafeAssign(fReporter, r); 53 SkRefCnt_SafeAssign(fReporter, r);
52 } 54 }
53 55
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 } 116 }
115 fReporter->endTest(this); 117 fReporter->endTest(this);
116 118
117 } 119 }
118 120
119 SkString Test::GetTmpDir() { 121 SkString Test::GetTmpDir() {
120 const char* tmpDir = FLAGS_tmpDir.isEmpty() ? NULL : FLAGS_tmpDir[0]; 122 const char* tmpDir = FLAGS_tmpDir.isEmpty() ? NULL : FLAGS_tmpDir[0];
121 return SkString(tmpDir); 123 return SkString(tmpDir);
122 } 124 }
123 125
124 static const char* gResourcePath = NULL; 126 void Test::SetResourcePath(const char* resourcePath) {
125 void Test::SetResourcePath(const char* resourcePath) { gResourcePath = resourceP ath; } 127 gResourcePath = resourcePath;
128 }
126 129
127 SkString Test::GetResourcePath() { 130 SkString Test::GetResourcePath() {
128 return SkString(gResourcePath); 131 return SkString(gResourcePath);
129 } 132 }
OLDNEW
« no previous file with comments | « tests/Test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698