Index: tests/Test.h |
diff --git a/tests/Test.h b/tests/Test.h |
index ed5de0f8607201e818c2abdca6d436164359e787..c1e0c528fb5a0384af7677c860c42e8322f18163 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 |