aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Test.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Test.h')
-rw-r--r--tests/Test.h12
1 files changed, 12 insertions, 0 deletions
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<Test> 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<SkDocument> testDoc(SkDocument::CreatePDF(&testStream)); \
+ if (!testDoc) { \
+ if ((REPORTER) && (REPORTER)->verbose()) { \
+ SkDebugf("PDF disabled; %s test skipped.", #TEST_NAME); \
+ } \
+ return; \
+ } \
+ } while (false)
+
#endif