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/AnnotationTest.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tests/AnnotationTest.cpp') diff --git a/tests/AnnotationTest.cpp b/tests/AnnotationTest.cpp index a40a5f427b..4f904bdc42 100644 --- a/tests/AnnotationTest.cpp +++ b/tests/AnnotationTest.cpp @@ -12,8 +12,6 @@ #include "SkStream.h" #include "Test.h" -#if SK_SUPPORT_PDF - /** Returns true if data (may contain null characters) contains needle (null * terminated). */ static bool ContainsString(const char* data, size_t dataSize, const char* needle) { @@ -42,6 +40,7 @@ DEF_TEST(Annotation_NoDraw, reporter) { } DEF_TEST(Annotation_PdfLink, reporter) { + REQUIRE_PDF_DOCUMENT(Annotation_PdfLink, reporter); SkDynamicMemoryWStream outStream; SkAutoTUnref doc(SkDocument::CreatePDF(&outStream)); SkCanvas* canvas = doc->beginPage(612.0f, 792.0f); @@ -60,6 +59,7 @@ DEF_TEST(Annotation_PdfLink, reporter) { } DEF_TEST(Annotation_NamedDestination, reporter) { + REQUIRE_PDF_DOCUMENT(Annotation_NamedDestination, reporter); SkDynamicMemoryWStream outStream; SkAutoTUnref doc(SkDocument::CreatePDF(&outStream)); SkCanvas* canvas = doc->beginPage(612.0f, 792.0f); @@ -76,4 +76,3 @@ DEF_TEST(Annotation_NamedDestination, reporter) { REPORTER_ASSERT(reporter, ContainsString(rawOutput, out->size(), "/example ")); } -#endif // SK_SUPPORT_PDF -- cgit v1.2.3