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

Side by Side Diff: tests/Test.h

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/KtxTest.cpp ('k') | tests/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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #ifndef skiatest_Test_DEFINED 8 #ifndef skiatest_Test_DEFINED
9 #define skiatest_Test_DEFINED 9 #define skiatest_Test_DEFINED
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 Reporter* getReporter() const { return fReporter; } 55 Reporter* getReporter() const { return fReporter; }
56 void setReporter(Reporter*); 56 void setReporter(Reporter*);
57 57
58 const char* getName(); 58 const char* getName();
59 void run(); 59 void run();
60 bool passed() const { return fPassed; } 60 bool passed() const { return fPassed; }
61 SkMSec elapsedMs() const { return fElapsed; } 61 SkMSec elapsedMs() const { return fElapsed; }
62 62
63 static SkString GetTmpDir(); 63 static SkString GetTmpDir();
64 64
65 static void SetResourcePath(const char*);
66 static SkString GetResourcePath();
67
68 virtual bool isGPUTest() const { return false; } 65 virtual bool isGPUTest() const { return false; }
69 virtual void setGrContextFactory(GrContextFactory* factory) {} 66 virtual void setGrContextFactory(GrContextFactory* factory) {}
70 67
71 protected: 68 protected:
72 virtual void onGetName(SkString*) = 0; 69 virtual void onGetName(SkString*) = 0;
73 virtual void onRun(Reporter*) = 0; 70 virtual void onRun(Reporter*) = 0;
74 71
75 private: 72 private:
76 static const char* gResourcePath;
77
78 Reporter* fReporter; 73 Reporter* fReporter;
79 SkString fName; 74 SkString fName;
80 bool fPassed; 75 bool fPassed;
81 SkMSec fElapsed; 76 SkMSec fElapsed;
82 }; 77 };
83 78
84 class GpuTest : public Test{ 79 class GpuTest : public Test{
85 public: 80 public:
86 GpuTest() : Test(), fGrContextFactory(NULL) {} 81 GpuTest() : Test(), fGrContextFactory(NULL) {}
87 82
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 } \ 166 } \
172 virtual void onRun(Reporter* r) SK_OVERRIDE { \ 167 virtual void onRun(Reporter* r) SK_OVERRIDE { \
173 name(r, fGrContextFactory); \ 168 name(r, fGrContextFactory); \
174 } \ 169 } \
175 }; \ 170 }; \
176 static TestRegistry gReg_##name##Class(name##Class::Factory); \ 171 static TestRegistry gReg_##name##Class(name##Class::Factory); \
177 } \ 172 } \
178 static void name(skiatest::Reporter* reporter, GrContextFactory* factory) 173 static void name(skiatest::Reporter* reporter, GrContextFactory* factory)
179 174
180 #endif 175 #endif
OLDNEW
« no previous file with comments | « tests/KtxTest.cpp ('k') | tests/Test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698