OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |