Avoid side effects related to skia error callbacks in the testing infrastructure

BUG=

Review URL: https://codereview.chromium.org/14447018

git-svn-id: http://skia.googlecode.com/svn/trunk@8867 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
humper@google.com 2013-04-25 18:33:49 +00:00
parent 49ce11ba14
commit 8dd94f0931

View File

@ -10,6 +10,7 @@
#include "SkString.h"
#include "SkTArray.h"
#include "SkTime.h"
#include "SkError.h"
#if SK_SUPPORT_GPU
#include "GrContext.h"
@ -92,6 +93,10 @@ namespace {
} // namespace
void Test::run() {
// Clear the Skia error callback before running any test, to ensure that tests
// don't have unintended side effects when running more than one.
SkSetErrorCallback( NULL, NULL );
// Tell (likely shared) fReporter that this test has started.
fReporter->startTest(this);
@ -108,6 +113,7 @@ void Test::run() {
fReporter->report(local.failure(i), Reporter::kFailed);
}
fReporter->endTest(this);
}
///////////////////////////////////////////////////////////////////////////////