Refactor: clean up some unused or mostly-unused API I saw here.

BUG=
R=bungeman@google.com, reed@google.com

Author: mtklein@google.com

Review URL: https://chromiumcodereview.appspot.com/17414003

git-svn-id: http://skia.googlecode.com/svn/trunk@9668 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/DataRefTest.cpp b/tests/DataRefTest.cpp
index b6daaf9..313a610 100644
--- a/tests/DataRefTest.cpp
+++ b/tests/DataRefTest.cpp
@@ -273,7 +273,7 @@
         if (!writer.isValid()) {
             SkString msg;
             msg.printf("Failed to create tmp file %s\n", path.c_str());
-            reporter->reportFailed(msg.c_str());
+            reporter->reportFailed(msg);
             return;
         }
         writer.write(s, 26);
diff --git a/tests/EmptyPathTest.cpp b/tests/EmptyPathTest.cpp
index 5c054ec..153af1f 100644
--- a/tests/EmptyPathTest.cpp
+++ b/tests/EmptyPathTest.cpp
@@ -59,7 +59,7 @@
         }
         appendStr(&str, paint);
         appendStr(&str, path);
-        reporter->report(str.c_str(), skiatest::Reporter::kFailed);
+        reporter->reportFailed(str);
 
 // uncomment this if you want to step in to see the failure
 //        canvas.drawPath(path, p);
diff --git a/tests/StreamTest.cpp b/tests/StreamTest.cpp
index 00c079a..cf82843 100644
--- a/tests/StreamTest.cpp
+++ b/tests/StreamTest.cpp
@@ -44,7 +44,7 @@
         if (!writer.isValid()) {
             SkString msg;
             msg.printf("Failed to create tmp file %s\n", path.c_str());
-            reporter->reportFailed(msg.c_str());
+            reporter->reportFailed(msg);
             return;
         }
 
diff --git a/tests/Test.cpp b/tests/Test.cpp
index f8f2e62..32c293e 100644
--- a/tests/Test.cpp
+++ b/tests/Test.cpp
@@ -31,8 +31,8 @@
     this->onStart(test);
 }
 
-void Reporter::report(const char desc[], Result result) {
-    this->onReport(desc ? desc : "<no description>", result);
+void Reporter::reportFailed(const SkString& desc) {
+    this->onReportFailed(desc);
 }
 
 void Reporter::endTest(Test* test) {
@@ -64,13 +64,11 @@
         explicit LocalReporter(Reporter* reporterToMimic) : fReporter(reporterToMimic) {}
 
         int failure_size() const { return fFailures.count(); }
-        const char* failure(int i) const { return fFailures[i].c_str(); }
+        const SkString& failure(int i) const { return fFailures[i]; }
 
     protected:
-        void onReport(const char desc[], Result result) SK_OVERRIDE {
-            if (kFailed == result) {
-                fFailures.push_back().set(desc);
-            }
+        void onReportFailed(const SkString& desc) SK_OVERRIDE {
+            fFailures.push_back(desc);
         }
 
         // Proxy down to fReporter.  We assume these calls are threadsafe.
@@ -110,7 +108,7 @@
 
     // Now tell fReporter about any failures and wrap up.
     for (int i = 0; i < local.failure_size(); i++) {
-      fReporter->report(local.failure(i), Reporter::kFailed);
+      fReporter->reportFailed(local.failure(i));
     }
     fReporter->endTest(this);
 
diff --git a/tests/Test.h b/tests/Test.h
index 8cb23c1..fa62afe 100644
--- a/tests/Test.h
+++ b/tests/Test.h
@@ -25,35 +25,19 @@
         SK_DECLARE_INST_COUNT(Reporter)
         Reporter();
 
-        enum Result {
-            kPassed,    // must begin with 0
-            kFailed,
-            /////
-            kLastResult = kFailed
-        };
-
         int countTests() const { return fTestCount; }
 
         void startTest(Test*);
-        void report(const char testDesc[], Result);
+        void reportFailed(const SkString& desc);
         void endTest(Test*);
 
         virtual bool allowExtendedTest() const { return false; }
         virtual bool allowThreaded() const { return false; }
         virtual void bumpTestCount() { sk_atomic_inc(&fTestCount); }
 
-        // helpers for tests
-        void reportFailed(const char desc[]) {
-            this->report(desc, kFailed);
-        }
-        void reportFailed(const SkString& desc) {
-            this->report(desc.c_str(), kFailed);
-        }
-
-
     protected:
         virtual void onStart(Test*) {}
-        virtual void onReport(const char desc[], Result) {}
+        virtual void onReportFailed(const SkString& desc) {}
         virtual void onEnd(Test*) {}
 
     private:
diff --git a/tests/skia_test.cpp b/tests/skia_test.cpp
index 8cae656..98168c5 100644
--- a/tests/skia_test.cpp
+++ b/tests/skia_test.cpp
@@ -55,10 +55,6 @@
     const TestRegistry* fReg;
 };
 
-static const char* result2string(Reporter::Result result) {
-    return result == Reporter::kPassed ? "passed" : "FAILED";
-}
-
 class DebugfReporter : public Reporter {
 public:
     DebugfReporter(bool allowExtendedTest, bool allowThreaded)
@@ -87,8 +83,8 @@
         sk_atomic_inc(&fPending);
         SkDebugf("[%3d/%3d] (%d) %s\n", index+1, fTotal, fPending, test->getName());
     }
-    virtual void onReport(const char desc[], Reporter::Result result) {
-        SkDebugf("\t%s: %s\n", result2string(result), desc);
+    virtual void onReportFailed(const SkString& desc) {
+        SkDebugf("\tFAILED: %s\n", desc.c_str());
     }
 
     virtual void onEnd(Test* test) {