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

Side by Side Diff: dm/DMTestTask.h

Issue 788243008: Sketch DM refactor. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: better failure messages, disable a few things temporarily to try to go green Created 5 years, 11 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 | « dm/DMTaskRunner.cpp ('k') | dm/DMTestTask.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #ifndef DMTestTask_DEFINED
2 #define DMTestTask_DEFINED
3
4 #include "DMReporter.h"
5 #include "DMJsonWriter.h"
6 #include "DMTask.h"
7 #include "DMTaskRunner.h"
8 #include "SkString.h"
9 #include "SkTemplates.h"
10 #include "Test.h"
11
12 // Runs a unit test.
13 namespace DM {
14
15 class TestReporter : public skiatest::Reporter {
16 public:
17 TestReporter() {}
18
19 const SkTArray<SkString>& failures() const { return fFailures; }
20
21 private:
22 bool allowExtendedTest() const SK_OVERRIDE;
23 bool verbose() const SK_OVERRIDE;
24
25 void onReportFailed(const skiatest::Failure& failure) SK_OVERRIDE {
26 JsonWriter::AddTestFailure(failure);
27
28 SkString newFailure;
29 failure.getFailureString(&newFailure);
30 fFailures.push_back(newFailure);
31 }
32
33 SkTArray<SkString> fFailures;
34 };
35
36 class CpuTestTask : public CpuTask {
37 public:
38 CpuTestTask(Reporter*, TaskRunner*, skiatest::TestRegistry::Factory);
39
40 void draw() SK_OVERRIDE;
41 bool shouldSkip() const SK_OVERRIDE { return false; }
42 SkString name() const SK_OVERRIDE { return fName; }
43
44 private:
45 TestReporter fTestReporter;
46 SkAutoTDelete<skiatest::Test> fTest;
47 const SkString fName;
48 };
49
50 class GpuTestTask : public GpuTask {
51 public:
52 GpuTestTask(Reporter*, TaskRunner*, skiatest::TestRegistry::Factory);
53
54 void draw(GrContextFactory*) SK_OVERRIDE;
55 bool shouldSkip() const SK_OVERRIDE;
56 SkString name() const SK_OVERRIDE { return fName; }
57
58 private:
59 TestReporter fTestReporter;
60 SkAutoTDelete<skiatest::Test> fTest;
61 const SkString fName;
62 };
63
64 } // namespace DM
65
66 #endif // DMTestTask_DEFINED
OLDNEW
« no previous file with comments | « dm/DMTaskRunner.cpp ('k') | dm/DMTestTask.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698