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

Unified Diff: tests/AnnotationTest.cpp

Issue 936403002: PDF: why do we have flags no one uses (or can use)? (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pdf/SkPDFStream.cpp ('k') | tests/PDFPrimitivesTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/AnnotationTest.cpp
diff --git a/tests/AnnotationTest.cpp b/tests/AnnotationTest.cpp
index 274d53ea4ff86ef1529a206c37d4a008b4692866..0ba3af9e9b84c9f4b2d150b1ccbaf4d6944d2f5f 100644
--- a/tests/AnnotationTest.cpp
+++ b/tests/AnnotationTest.cpp
@@ -39,11 +39,6 @@ DEF_TEST(Annotation_NoDraw, reporter) {
REPORTER_ASSERT(reporter, 0 == *bm.getAddr32(0, 0));
}
-struct testCase {
- SkPDFDocument::Flags flags;
- bool expectAnnotations;
-};
-
DEF_TEST(Annotation_PdfLink, reporter) {
SkISize size = SkISize::Make(612, 792);
SkMatrix initialTransform;
@@ -56,20 +51,14 @@ DEF_TEST(Annotation_PdfLink, reporter) {
SkAutoDataUnref data(SkData::NewWithCString("http://www.gooogle.com"));
SkAnnotateRectWithURL(&canvas, r, data.get());
- testCase tests[] = {{(SkPDFDocument::Flags)0, true},
- {SkPDFDocument::kNoLinks_Flags, false}};
- for (size_t testNum = 0; testNum < SK_ARRAY_COUNT(tests); testNum++) {
- SkPDFDocument doc(tests[testNum].flags);
- doc.appendPage(&device);
- SkDynamicMemoryWStream outStream;
- doc.emitPDF(&outStream);
- SkAutoDataUnref out(outStream.copyToData());
- const char* rawOutput = (const char*)out->data();
+ SkPDFDocument doc;
+ doc.appendPage(&device);
+ SkDynamicMemoryWStream outStream;
+ doc.emitPDF(&outStream);
+ SkAutoDataUnref out(outStream.copyToData());
+ const char* rawOutput = (const char*)out->data();
- REPORTER_ASSERT(reporter,
- ContainsString(rawOutput, out->size(), "/Annots ")
- == tests[testNum].expectAnnotations);
- }
+ REPORTER_ASSERT(reporter, ContainsString(rawOutput, out->size(), "/Annots "));
}
DEF_TEST(Annotation_NamedDestination, reporter) {
« no previous file with comments | « src/pdf/SkPDFStream.cpp ('k') | tests/PDFPrimitivesTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698