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

Side by Side Diff: tests/Test.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 | « tests/Test.h ('k') | tests/skia_test.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 2011 Google Inc. 2 * Copyright 2011 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 "Test.h" 8 #include "Test.h"
9 9
10 #include "SkCommandLineFlags.h" 10 #include "SkCommandLineFlags.h"
(...skipping 23 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
46 Test::Test() : fReporter(NULL), fPassed(true) {} 44 Test::Test() : fReporter(NULL), fPassed(true) {}
47 45
48 Test::~Test() { 46 Test::~Test() {
49 SkSafeUnref(fReporter); 47 SkSafeUnref(fReporter);
50 } 48 }
51 49
52 void Test::setReporter(Reporter* r) { 50 void Test::setReporter(Reporter* r) {
53 SkRefCnt_SafeAssign(fReporter, r); 51 SkRefCnt_SafeAssign(fReporter, r);
54 } 52 }
55 53
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 fReporter->reportFailed(local.failure(i)); 113 fReporter->reportFailed(local.failure(i));
116 } 114 }
117 fReporter->endTest(this); 115 fReporter->endTest(this);
118 116
119 } 117 }
120 118
121 SkString Test::GetTmpDir() { 119 SkString Test::GetTmpDir() {
122 const char* tmpDir = FLAGS_tmpDir.isEmpty() ? NULL : FLAGS_tmpDir[0]; 120 const char* tmpDir = FLAGS_tmpDir.isEmpty() ? NULL : FLAGS_tmpDir[0];
123 return SkString(tmpDir); 121 return SkString(tmpDir);
124 } 122 }
125
126 void Test::SetResourcePath(const char* resourcePath) {
127 gResourcePath = resourcePath;
128 }
129
130 SkString Test::GetResourcePath() {
131 return SkString(gResourcePath);
132 }
OLDNEW
« no previous file with comments | « tests/Test.h ('k') | tests/skia_test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698