summaryrefslogtreecommitdiff
path: root/testing/test_support.h
AgeCommit message (Collapse)Author
2018-06-01Fix XFA guardsRyan Harrison
These guards are using #if, when they should be using #ifdef. Caught using Clang's static analyzer. Change-Id: I86e99c5e4142cf84fff5f2365ad534f09ae40511 Reviewed-on: https://pdfium-review.googlesource.com/33510 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-02-13Remove old version of InitializeV8ForPDFium().Lei Zhang
Change-Id: I5dbf1c78cf794eff817de9f5831b1fb5b49c84ab Reviewed-on: https://pdfium-review.googlesource.com/26491 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-02-08[v8-platform] Store the platform in a unique_ptr. (Try 2)Lei Zhang
We want to change the signature of {CreateDefaultPlatform} in the V8 API to return a unique_ptr instead of a raw pointer to indicate that the caller owns the platform. With this change we prepare pdfium for this change. In this second attempt, keep the old InitializeV8ForPDFium() method around to complete the Chromium DEPS roll. Once that lands safely, remove it from PDFium. This relands commit 608e8dd6 and commit 3355f459, which commit b3a3eaab reverts. Change-Id: Icc60b17ca202637d34ae242c0785d939194d0fe6 Reviewed-on: https://pdfium-review.googlesource.com/25950 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-02-07Revert "[v8-platform] Store the platform in a unique_ptr"Dan Sinclair
This reverts commit 608e8dd6b87b15772862dca9b7b2e6791a25dab6. Reason for revert: Breaks the roll into Chromium pdf/pdfium/fuzzers/pdfium_fuzzer_helper.cc:238:5: error: no matching function for call to 'InitializeV8ForPDFium' InitializeV8ForPDFium(ProgramPath(), "", &natives_blob, &snapshot_blob, ^~~~~~~~~~~~~~~~~~~~~ ../../third_party/pdfium/testing/test_support.h:94:31: note: candidate function not viable: requires 4 arguments, but 5 were provided std::unique_ptr<v8::Platform> InitializeV8ForPDFium( ^ https://logs.chromium.org/v/?s=chromium%2Fbb%2Ftryserver.chromium.linux%2Flinux_chromium_compile_dbg_ng%2F461077%2F%2B%2Frecipes%2Fsteps%2Fcompile__with_patch_%2F0%2Fstdout Original change's description: > [v8-platform] Store the platform in a unique_ptr > > We want to change the signature of {CreateDefaultPlatform} in the V8 > API to return a unique_ptr instead of a raw pointer to indicate that the > caller owns the platform. With this change we prepare pdfium for this > change. > > R=​thestig@chromium.org > > Change-Id: I4a0a466dfc37b28387a91543623a7a481ca8035a > Reviewed-on: https://pdfium-review.googlesource.com/18191 > Commit-Queue: Lei Zhang <thestig@chromium.org> > Reviewed-by: Lei Zhang <thestig@chromium.org> TBR=thestig@chromium.org,ahaas@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Change-Id: I418c97653e8aba93560537f0d41e1aaa238bf3b4 Reviewed-on: https://pdfium-review.googlesource.com/25850 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-02-05Fix testing.cpp build with v8_use_external_startup_data=false.Lei Zhang
Also change the InitializeV8ForPDFium() for use with startup data to InitializeV8ForPDFiumWithStartupData(). Change-Id: I594c2bf9470b6549195b7361bb7fcb45def50c61 Reviewed-on: https://pdfium-review.googlesource.com/25371 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-02-05[v8-platform] Store the platform in a unique_ptrAndreas Haas
We want to change the signature of {CreateDefaultPlatform} in the V8 API to return a unique_ptr instead of a raw pointer to indicate that the caller owns the platform. With this change we prepare pdfium for this change. R=thestig@chromium.org Change-Id: I4a0a466dfc37b28387a91543623a7a481ca8035a Reviewed-on: https://pdfium-review.googlesource.com/18191 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-11-02Remove some C-style const char* casts.Lei Zhang
Change-Id: I4785dd277b9da072ee3c55e2aaeb688bbf02852e Reviewed-on: https://pdfium-review.googlesource.com/17391 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-08-28Add a global font loader in XFA testsDan Sinclair
This CL creates a global font loader for use in XFA tests. This is needed because the CFGAS_FontMangaer takes a linearly increasing amount of time to load fonts each time it's loaded. This can get excessively slow for test suites which run a lot of tests. Change-Id: Ie389844b56598ce414f4f761654fa4ed465955fd Reviewed-on: https://pdfium-review.googlesource.com/12090 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-07-19Added testing flag --save-attachments that saves embedded attachmentsJane Liu
1. Added --save-attachments flag in pdfium_test to save embedded attachments using fpdf_attachment APIs. Bug=pdfium:174 Change-Id: I62f09aeb0ab1431f6e127da389518878a7214423 Reviewed-on: https://pdfium-review.googlesource.com/7990 Commit-Queue: Jane Liu <janeliulwq@google.com> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-07-05Allow EmbedderTest to test savingNicolas Pena
This CL adds helper methods for EmbedderTest to save. This means that TestSaver is no longer needed and all the methods it uses are moved to the EmbedderTest. Change-Id: I740f29699bfd8c6b570cb1fd85e7aab9bc1d3f6f Reviewed-on: https://pdfium-review.googlesource.com/7171 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-06-22Clean up includes in testing/test_support.hLei Zhang
Change-Id: Id558c36d10501ce488717045bbf00bfed32e4b92 Reviewed-on: https://pdfium-review.googlesource.com/6870 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-06-19Consistently pass FPDF handles by value.Lei Zhang
Change-Id: I1b31217c756620873f59527768464aec02a82900 Reviewed-on: https://pdfium-review.googlesource.com/6677 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-05-02Change BarcodeTest to render to bitmaps.Lei Zhang
BarcodeTest renders to bitmaps verifies their checksums. Add some commonly used checksumming code to testing/test_support.h, and use it in tests that have duplicate code. Change-Id: I4a440674ff1084685b5d89576d967333da458a8a Reviewed-on: https://pdfium-review.googlesource.com/4618 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-04-24Use a pdfium-specific unittest main rather than gtest'sTom Sepez
We must initialize our partition allocator before calling into any test cases. We can then remove the FPDF_Test class, which did the same thing. Change-Id: I614480fa474b2032052857a02e94781f15a27a4e Reviewed-on: https://pdfium-review.googlesource.com/4473 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-04-13Add embeddertest for form text rendering and savingNicolas Pena
This CL adds an embeddertest that adds text to a textfield and saves it. It also adds a new 'charcode' option for .evt files in pdfium_test. Change-Id: I14fbf50e2b1d5ae0bdc68d1dd25dc4f889c49bfb Reviewed-on: https://pdfium-review.googlesource.com/4150 Commit-Queue: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-26Use PartitionAlloc for JavaScript ArrayBuffers and strings.Chris Palmer
BUG=pdfium:681 Change-Id: I5073d80d9bd623b73e578d5ba2226c39c371bab0 Reviewed-on: https://pdfium-review.googlesource.com/3097 Commit-Queue: Chris Palmer <palmer@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2016-06-09Roll V8 and its deps and update ICU initialization callchromium/2764jochen
R=machenbach@chromium.org,thestig@chromium.org BUG= Review-Url: https://codereview.chromium.org/2053603002
2016-04-18Allow pdfium_test to send simple events to each page.tsepez
We add the --send-events flag, which causes pdfium_test to look for a .evt file with the same base name as the .pdf file being rendered, and to use its contents to drive calls to FORM_* APIs. The .evt file syntax is crude, roughly: # comments keycode,65 mousedown,right,300,300 # more comments mouseup,right,300,300 mousemove,300,300 Review URL: https://codereview.chromium.org/1898993002
2016-02-18Clean up CPDF_FileSpec and add unit testsWei Li
Change implicit conversion to accessor function, remove unused function and unused parameter, add a couple checks for null pointers, and some cleanup. BUG=pdfium:247 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1703183002 .
2016-02-18Fixup incorrect include guards.Dan Sinclair
This CL updates include guards throughout the code base to be in the chromium style. BUG=pdfium:65 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1707893004 .
2016-02-18Sort headers in non-xfa directories.Dan Sinclair
This CL runs the chromium sort-headers.py script over the non-xfa code. XFA will be done after the includes have been updated to full paths. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1711793002 .
2016-02-16Refactor CPDF_SimpleParser and add unit tests.Wei Li
Remove unused member functions and simplify calls to find tag parameters. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1681403007 .
2016-02-16Simplify string function test macroWei Li
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1701123002 .
2016-02-09Add unit tests for ascii85 and hex decoders.chromium/2652chromium/2651chromium/2650chromium/2649chromium/2648chromium/2647chromium/2646Wei Li
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1666663004 .
2016-01-07Merge to XFA: Disentangle fpdfsave_embeddertest's FPDF_FILEWRITE.Tom Sepez
Original Review URL: https://codereview.chromium.org/1561303002 . (cherry picked from commit 5dc13d7858f9caf58b0e12f38823300a739302e2) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1569973002 .
2016-01-06Merge to XFA: Return unique_ptrs from test_support functionsTom Sepez
Orignal Review URL: https://codereview.chromium.org/1563513002 . (cherry picked from commit aa326bd6b169dc1b5b9b83048c71799799ab34c6) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1564583004 .
2016-01-05Merge to XFA: Make FPDF_WIDESTRING work regardless of endianness.Tom Sepez
Original Review URL: https://codereview.chromium.org/1554363002 . (cherry picked from commit ed34cdf99d5a4b33e57f81f9244a311f6fb86db3) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1559373002 .
2015-11-06Merge to XFA: Fix all relative includes to public.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1415803007 . (cherry picked from commit 5899671184d01b74989d181363066379ef3e4051) Review URL: https://codereview.chromium.org/1431593007 .
2015-11-06Merge to XFA: Fix all relative includes to third_party.Lei Zhang
- In non-standalone builds, use the provided jpeg library. - Run gn format over all the GN files. - Also roll DEPS for buildtools to c2f2598. - And fix XFA's lack of #includes. BUG=541704 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1425153006 . (cherry picked from commit 34bb6c58fe60206a08dc0a1f37b7cfe83e8c762c) Review URL: https://codereview.chromium.org/1434543003 .
2015-11-04Merge to XFA: Make JS app.setTimeOut() work again.Lei Zhang
This regressed in commit 794c9b6. BUG=551248 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1424743006 . (cherry picked from commit 8cadf995e9a0fec8da19f69edac9d10fccca7eed) (cherry picked from commit 955930dce7e4b5c764cdd34b134baea4207de523) Review URL: https://codereview.chromium.org/1416663008 .
2015-10-19Merge to XFA: Consolidate test support code.Tom Sepez
Original Review URL: https://codereview.chromium.org/1416713002 . (cherry picked from commit 6d34d056a7188b7ae9800fe3ceb68645e0442879) Conflicts: BUILD.gn samples/BUILD.gn samples/pdfium_test.cc samples/samples.gyp R=thestig@chromium.org Review URL: https://codereview.chromium.org/1413593003 .