From 526f6d5279141b270898e7e07ded7b4ce021d0d6 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Wed, 28 Jan 2015 15:49:13 -0800 Subject: Cover fpdftext.h API with embeddertests. R=thestig@chromium.org Review URL: https://codereview.chromium.org/878333003 --- testing/resources/hello_world.in | 56 +++++++++++++++++++++++++++++ testing/resources/hello_world.pdf | 66 ++++++++++++++++++++++++++++++++++ testing/resources/weblinks.in | 66 ++++++++++++++++++++++++++++++++++ testing/resources/weblinks.pdf | 76 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 264 insertions(+) create mode 100644 testing/resources/hello_world.in create mode 100644 testing/resources/hello_world.pdf create mode 100644 testing/resources/weblinks.in create mode 100644 testing/resources/weblinks.pdf (limited to 'testing') diff --git a/testing/resources/hello_world.in b/testing/resources/hello_world.in new file mode 100644 index 0000000000..19fce0ce33 --- /dev/null +++ b/testing/resources/hello_world.in @@ -0,0 +1,56 @@ +{{header}} +{{object 1 0}} << + /Type /Catalog + /Pages 2 0 R +>> +{{object 2 0}} << + /Type /Pages + /MediaBox [ 0 0 200 200 ] + /Count 1 + /Kids [ 3 0 R ] +>> +endobj +{{object 3 0}} << + /Type /Page + /Parent 2 0 R + /Resources << + /Font << + /F1 4 0 R + /F2 5 0 R + >> + >> + /Contents 6 0 R +>> +endobj +{{object 4 0}} << + /Type /Font + /Subtype /Type1 + /BaseFont /Times-Roman +>> +endobj +{{object 5 0}} << + /Type /Font + /Subtype /Type1 + /BaseFont /Helvetica +>> +endobj +{{object 6 0}} << +>> +stream +BT +20 50 Td +/F1 12 Tf +(Hello, world!) Tj +0 50 Td +/F2 16 Tf +(Goodbye, world!) Tj +ET +endstream +endobj +{{xref}} +trailer << + /Size 6 + /Root 1 0 R +>> +{{startxref}} +%%EOF diff --git a/testing/resources/hello_world.pdf b/testing/resources/hello_world.pdf new file mode 100644 index 0000000000..84e77057cb --- /dev/null +++ b/testing/resources/hello_world.pdf @@ -0,0 +1,66 @@ +%PDF-1.7 +% ò¤ô +1 0 obj << + /Type /Catalog + /Pages 2 0 R +>> +2 0 obj << + /Type /Pages + /MediaBox [ 0 0 200 200 ] + /Count 1 + /Kids [ 3 0 R ] +>> +endobj +3 0 obj << + /Type /Page + /Parent 2 0 R + /Resources << + /Font << + /F1 4 0 R + /F2 5 0 R + >> + >> + /Contents 6 0 R +>> +endobj +4 0 obj << + /Type /Font + /Subtype /Type1 + /BaseFont /Times-Roman +>> +endobj +5 0 obj << + /Type /Font + /Subtype /Type1 + /BaseFont /Helvetica +>> +endobj +6 0 obj << +>> +stream +BT +20 50 Td +/F1 12 Tf +(Hello, world!) Tj +0 50 Td +/F2 16 Tf +(Goodbye, world!) Tj +ET +endstream +endobj +xref +0 7 +0000000000 65536 f +0000000015 00000 n +0000000061 00000 n +0000000154 00000 n +0000000296 00000 n +0000000374 00000 n +0000000450 00000 n +trailer << + /Size 6 + /Root 1 0 R +>> +startxref +571 +%%EOF diff --git a/testing/resources/weblinks.in b/testing/resources/weblinks.in new file mode 100644 index 0000000000..ed20b2e642 --- /dev/null +++ b/testing/resources/weblinks.in @@ -0,0 +1,66 @@ +{{header}} +{{object 1 0}} << + /Type /Catalog + /Pages 2 0 R +>> +{{object 2 0}} << + /Type /Pages + /MediaBox [ 0 0 600 600 ] + /Count 1 + /Kids [ 3 0 R ] +>> +endobj +{{object 3 0}} << + /Type /Page + /Parent 2 0 R + /Resources << + /Font << + /F1 4 0 R + /F2 5 0 R + >> + >> + /Contents 6 0 R +>> +endobj +{{object 4 0}} << + /Type /Font + /Subtype /Type1 + /BaseFont /Times-Roman +>> +endobj +{{object 4 0}} << + /Type /Font + /Subtype /Type1 + /BaseFont /Helvetica +>> +endobj +{{object 6 0}} << +>> +stream +BT +/F1 12 Tf +50 50 Td +(Hello, world! This is not a link.) Tj +0 50 Td +(http://example.com?q=foo. This might be a link.) Tj +/F2 16 Tf +0 50 Td +(https://example.com?q=foo. This might be a link in another font.) Tj +0 50 Td +(javascript:alert(0). This might be a JS link.) Tj +0 50 Td +(ftp://example.org. This might be a FTP link.) Tj +0 50 Td +(file:///home/foo/example.txt. This might be a file link.) Tj +0 50 Td +(This is a rather long and pointless piece of non-link text.) Tj +ET +endstream +endobj +{{xref}} +trailer << + /Size 6 + /Root 1 0 R +>> +{{startxref}} +%%EOF diff --git a/testing/resources/weblinks.pdf b/testing/resources/weblinks.pdf new file mode 100644 index 0000000000..3921a37c79 --- /dev/null +++ b/testing/resources/weblinks.pdf @@ -0,0 +1,76 @@ +%PDF-1.7 +% ò¤ô +1 0 obj << + /Type /Catalog + /Pages 2 0 R +>> +2 0 obj << + /Type /Pages + /MediaBox [ 0 0 600 600 ] + /Count 1 + /Kids [ 3 0 R ] +>> +endobj +3 0 obj << + /Type /Page + /Parent 2 0 R + /Resources << + /Font << + /F1 4 0 R + /F2 5 0 R + >> + >> + /Contents 6 0 R +>> +endobj +4 0 obj << + /Type /Font + /Subtype /Type1 + /BaseFont /Times-Roman +>> +endobj +4 0 obj << + /Type /Font + /Subtype /Type1 + /BaseFont /Helvetica +>> +endobj +6 0 obj << +>> +stream +BT +/F1 12 Tf +50 50 Td +(Hello, world! This is not a link.) Tj +0 50 Td +(http://example.com?q=foo. This might be a link.) Tj +/F2 16 Tf +0 50 Td +(https://example.com?q=foo. This might be a link in another font.) Tj +0 50 Td +(javascript:alert(0). This might be a JS link.) Tj +0 50 Td +(ftp://example.org. This might be a FTP link.) Tj +0 50 Td +(file:///home/foo/example.txt. This might be a file link.) Tj +0 50 Td +(This is a rather long and pointless piece of non-link text.) Tj +ET +endstream +endobj +xref +0 7 +0000000000 65536 f +0000000015 00000 n +0000000061 00000 n +0000000154 00000 n +0000000374 00000 n +0000000000 65536 f +0000000450 00000 n +trailer << + /Size 6 + /Root 1 0 R +>> +startxref +963 +%%EOF -- cgit v1.2.3