OLD | NEW |
| 1 /* |
| 2 * Copyright 2013 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
1 #include "Test.h" | 7 #include "Test.h" |
2 | 8 |
3 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
4 #include "SkDocument.h" | 10 #include "SkDocument.h" |
5 #include "SkOSFile.h" | 11 #include "SkOSFile.h" |
6 #include "SkStream.h" | 12 #include "SkStream.h" |
| 13 #if SK_SUPPORT_PDF |
7 | 14 |
8 static void test_empty(skiatest::Reporter* reporter) { | 15 static void test_empty(skiatest::Reporter* reporter) { |
9 SkDynamicMemoryWStream stream; | 16 SkDynamicMemoryWStream stream; |
10 | 17 |
11 SkAutoTUnref<SkDocument> doc(SkDocument::CreatePDF(&stream)); | 18 SkAutoTUnref<SkDocument> doc(SkDocument::CreatePDF(&stream)); |
12 | 19 |
13 doc->close(); | 20 doc->close(); |
14 | 21 |
15 REPORTER_ASSERT(reporter, stream.bytesWritten() == 0); | 22 REPORTER_ASSERT(reporter, stream.bytesWritten() == 0); |
16 } | 23 } |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 REPORTER_ASSERT(reporter, stream.bytesWritten() != 0); | 103 REPORTER_ASSERT(reporter, stream.bytesWritten() != 0); |
97 } | 104 } |
98 | 105 |
99 DEF_TEST(document_tests, reporter) { | 106 DEF_TEST(document_tests, reporter) { |
100 test_empty(reporter); | 107 test_empty(reporter); |
101 test_abort(reporter); | 108 test_abort(reporter); |
102 test_abortWithFile(reporter); | 109 test_abortWithFile(reporter); |
103 test_file(reporter); | 110 test_file(reporter); |
104 test_close(reporter); | 111 test_close(reporter); |
105 } | 112 } |
| 113 #endif // SK_SUPPORT_PDF |
OLD | NEW |