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

Unified Diff: tests/Test.h

Issue 178273002: Let DM run unit tests. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gyp/tests.gypi ('k') | tests/Test.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/Test.h
diff --git a/tests/Test.h b/tests/Test.h
index 0a9c306b15963c4d1c611cbd13243f469c0c4edc..4d2cf2b6392349ed0751eb52274d3d219d27b7d9 100644
--- a/tests/Test.h
+++ b/tests/Test.h
@@ -62,9 +62,11 @@ namespace skiatest {
static SkString GetTmpDir();
+ static void SetResourcePath(const char*);
static SkString GetResourcePath();
virtual bool isGPUTest() const { return false; }
+ virtual void setGrContextFactory(GrContextFactory* factory) {}
protected:
virtual void onGetName(SkString*) = 0;
@@ -79,11 +81,15 @@ namespace skiatest {
class GpuTest : public Test{
public:
- GpuTest() : Test() {}
- static GrContextFactory* GetGrContextFactory();
- static void DestroyContexts();
+ GpuTest() : Test(), fGrContextFactory(NULL) {}
+
virtual bool isGPUTest() const { return true; }
- private:
+ virtual void setGrContextFactory(GrContextFactory* factory) {
+ fGrContextFactory = factory;
+ }
+
+ protected:
+ GrContextFactory* fGrContextFactory; // Unowned.
};
typedef SkTRegistry<Test*(*)(void*)> TestRegistry;
@@ -162,7 +168,7 @@ namespace skiatest {
name->set(#name); \
} \
virtual void onRun(Reporter* r) SK_OVERRIDE { \
- name(r, GetGrContextFactory()); \
+ name(r, fGrContextFactory); \
} \
}; \
static TestRegistry gReg_##name##Class(name##Class::Factory); \
« no previous file with comments | « gyp/tests.gypi ('k') | tests/Test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698