From 4125b6165d4314c6c64ce12d31b2565d52c6fad3 Mon Sep 17 00:00:00 2001 From: Hal Canary Date: Tue, 20 Mar 2018 14:17:00 -0400 Subject: tests: pass if !skia_enable_pdf Change-Id: Iff42b9a166d59b21a97fd2910d54beff1ec82969 Reviewed-on: https://skia-review.googlesource.com/115366 Reviewed-by: Hal Canary Commit-Queue: Hal Canary --- tests/CanvasTest.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tests/CanvasTest.cpp') diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp index 3c6cb22c33..402b24729a 100644 --- a/tests/CanvasTest.cpp +++ b/tests/CanvasTest.cpp @@ -135,7 +135,9 @@ template static void multi_canvas_driver(int w, int h, F proc) { proc(SkPictureRecorder().beginRecording(SkRect::MakeIWH(w, h))); SkNullWStream stream; - proc(SkDocument::MakePDF(&stream)->beginPage(SkIntToScalar(w), SkIntToScalar(h))); + if (auto doc = SkDocument::MakePDF(&stream)) { + proc(doc->beginPage(SkIntToScalar(w), SkIntToScalar(h))); + } proc(SkSurface::MakeRasterN32Premul(w, h, nullptr)->getCanvas()); } @@ -562,8 +564,8 @@ TEST_STEP(NestedSaveRestoreWithFlush, NestedSaveRestoreWithFlushTestStep); static void TestPdfDevice(skiatest::Reporter* reporter, const TestData& d, CanvasTestStep* step) { SkDynamicMemoryWStream outStream; sk_sp doc(SkDocument::MakePDF(&outStream)); - REPORTER_ASSERT(reporter, doc); if (!doc) { + INFOF(reporter, "PDF disabled; TestPdfDevice test skipped."); return; } SkCanvas* canvas = doc->beginPage(SkIntToScalar(d.fWidth), @@ -805,7 +807,9 @@ DEF_TEST(CanvasClipType, r) { // test clipstack backend SkDynamicMemoryWStream stream; - test_cliptype(SkDocument::MakePDF(&stream)->beginPage(100, 100), r); + if (auto doc = SkDocument::MakePDF(&stream)) { + test_cliptype(doc->beginPage(100, 100), r); + } } #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK -- cgit v1.2.3