Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Side by Side Diff: tests/PDFDocumentTest.cpp

Issue 1278403006: SkPDF: clean up overuse of SK_SUPPORT_PDF (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-11 (Tuesday) 16:25:36 EDT Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/PDFDeflateWStreamTest.cpp ('k') | tests/PDFFlateTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #include "Test.h" 7 #include "Test.h"
8 8
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkDocument.h" 10 #include "SkDocument.h"
11 #include "SkOSFile.h" 11 #include "SkOSFile.h"
12 #include "SkStream.h" 12 #include "SkStream.h"
13 #if SK_SUPPORT_PDF
14 13
15 static void test_empty(skiatest::Reporter* reporter) { 14 static void test_empty(skiatest::Reporter* reporter) {
16 SkDynamicMemoryWStream stream; 15 SkDynamicMemoryWStream stream;
17 16
18 SkAutoTUnref<SkDocument> doc(SkDocument::CreatePDF(&stream)); 17 SkAutoTUnref<SkDocument> doc(SkDocument::CreatePDF(&stream));
19 18
20 doc->close(); 19 doc->close();
21 20
22 REPORTER_ASSERT(reporter, stream.bytesWritten() == 0); 21 REPORTER_ASSERT(reporter, stream.bytesWritten() == 0);
23 } 22 }
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 SkCanvas* canvas = doc->beginPage(100, 100); 96 SkCanvas* canvas = doc->beginPage(100, 100);
98 canvas->drawColor(SK_ColorRED); 97 canvas->drawColor(SK_ColorRED);
99 doc->endPage(); 98 doc->endPage();
100 99
101 doc->close(); 100 doc->close();
102 101
103 REPORTER_ASSERT(reporter, stream.bytesWritten() != 0); 102 REPORTER_ASSERT(reporter, stream.bytesWritten() != 0);
104 } 103 }
105 104
106 DEF_TEST(document_tests, reporter) { 105 DEF_TEST(document_tests, reporter) {
106 REQUIRE_PDF_DOCUMENT(document_tests, reporter);
107 test_empty(reporter); 107 test_empty(reporter);
108 test_abort(reporter); 108 test_abort(reporter);
109 test_abortWithFile(reporter); 109 test_abortWithFile(reporter);
110 test_file(reporter); 110 test_file(reporter);
111 test_close(reporter); 111 test_close(reporter);
112 } 112 }
113 #endif // SK_SUPPORT_PDF
OLDNEW
« no previous file with comments | « tests/PDFDeflateWStreamTest.cpp ('k') | tests/PDFFlateTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698