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

Unified Diff: tests/PDFMetadataAttributeTest.cpp

Issue 1780463008: SkPDF: metadata first (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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 | « site/user/sample/pdf.md ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PDFMetadataAttributeTest.cpp
diff --git a/tests/PDFMetadataAttributeTest.cpp b/tests/PDFMetadataAttributeTest.cpp
index e436ee29efa2816fd3242e7632988e72780ff5aa..bfc2b41fa0152da17cb60f6ac3e653d608290c94 100644
--- a/tests/PDFMetadataAttributeTest.cpp
+++ b/tests/PDFMetadataAttributeTest.cpp
@@ -13,15 +13,18 @@ DEF_TEST(SkPDF_MetadataAttribute, r) {
REQUIRE_PDF_DOCUMENT(SkPDF_MetadataAttribute, r);
SkDynamicMemoryWStream pdf;
SkAutoTUnref<SkDocument> doc(SkDocument::CreatePDF(&pdf));
- SkTArray<SkDocument::Attribute> info;
- info.emplace_back(SkString("Title"), SkString("A1"));
- info.emplace_back(SkString("Author"), SkString("A2"));
- info.emplace_back(SkString("Subject"), SkString("A3"));
- info.emplace_back(SkString("Keywords"), SkString("A4"));
- info.emplace_back(SkString("Creator"), SkString("A5"));
+ typedef SkDocument::Attribute Attr;
+ Attr info[] = {
+ Attr(SkString("Title"), SkString("A1")),
+ Attr(SkString("Author"), SkString("A2")),
+ Attr(SkString("Subject"), SkString("A3")),
+ Attr(SkString("Keywords"), SkString("A4")),
+ Attr(SkString("Creator"), SkString("A5")),
+ };
+ int infoCount = sizeof(info) / sizeof(info[0]);
SkTime::DateTime now;
SkTime::GetDateTime(&now);
- doc->setMetadata(&info[0], info.count(), &now, &now);
+ doc->setMetadata(&info[0], infoCount, &now, &now);
doc->beginPage(612.0f, 792.0f);
doc->close();
SkAutoTUnref<SkData> data(pdf.copyToData());
« no previous file with comments | « site/user/sample/pdf.md ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698