From 2ccdb636e8618db77be8e05cdacd82c249c6898c Mon Sep 17 00:00:00 2001 From: halcanary Date: Tue, 11 Aug 2015 13:35:12 -0700 Subject: SkPDF: clean up overuse of SK_SUPPORT_PDF When possible use run-time checks (via SkDocument::CreatePDF) When PDF is disabled, do not compile tests/PDF*.cpp Review URL: https://codereview.chromium.org/1278403006 --- tests/Test.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/Test.h') diff --git a/tests/Test.h b/tests/Test.h index ed5de0f860..c1e0c528fb 100644 --- a/tests/Test.h +++ b/tests/Test.h @@ -102,4 +102,16 @@ typedef SkTRegistry TestRegistry; skiatest::Test(#name, true, test_##name)); \ void test_##name(skiatest::Reporter* reporter, GrContextFactory* factory) +#define REQUIRE_PDF_DOCUMENT(TEST_NAME, REPORTER) \ + do { \ + SkDynamicMemoryWStream testStream; \ + SkAutoTUnref testDoc(SkDocument::CreatePDF(&testStream)); \ + if (!testDoc) { \ + if ((REPORTER) && (REPORTER)->verbose()) { \ + SkDebugf("PDF disabled; %s test skipped.", #TEST_NAME); \ + } \ + return; \ + } \ + } while (false) + #endif -- cgit v1.2.3