summaryrefslogtreecommitdiff
path: root/testing
AgeCommit message (Collapse)Author
2015-11-04Enforce input and output dimensionalities for CPDF_StitchFunc.Oliver Chang
Also cleans up some places in the relevant functions since we're here. BUG=551460 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1421783004 .
2015-11-04Make checkdeps --resolve-dotdot succeed.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1419373005 .
2015-11-03Revert "One test runner to rule them all."Dan Sinclair
This reverts commit a1215ba51a235fb7abcb995f0e768ea0176d9275. Revert "Return result of the test runner." This reverts commit d1579c9b92b7f9c1d9e0fac1ecb8e3cb23875fca. Reverting the new test_runner code as there appears to be something string happening on the non-Linux boxes on XFA. It looks like it ran the font_size test twice, once with the .in and once with the .pdf. The .in was suppressed, the .pdf faild and wasn't suppressed. Rendering PDF file /Volumes/data/b/build/slave/mac_xfa/build/pdfium/out/Debug/gen/pdfium/testing/pixel/font_size.pdf. Rendered 1 pages. Skipped 0 bad pages. Checking /Volumes/data/b/build/slave/mac_xfa/build/pdfium/out/Debug/gen/pdfium/testing/pixel/font_size.pdf.0.png FAILURE: font_size.in; Command '['/Volumes/data/b/build/slave/mac_xfa/build/pdfium/out/Debug/pdfium_diff', '/Volumes/data/b/build/slave/mac_xfa/build/pdfium/testing/resources/pixel/font_size_expected.pdf.0.png', '/Volumes/data/b/build/slave/mac_xfa/build/pdfium/out/Debug/gen/pdfium/testing/pixel/font_size.pdf.0.png']' returned non-zero exit status 1 font_size.in is suppressed, found in SUPPRESSIONS_mac file Rendering PDF file /Volumes/data/b/build/slave/mac_xfa/build/pdfium/out/Debug/gen/pdfium/testing/pixel/font_size.pdf. Rendered 1 pages. Skipped 0 bad pages. Checking /Volumes/data/b/build/slave/mac_xfa/build/pdfium/out/Debug/gen/pdfium/testing/pixel/font_size.pdf.0.png FAILURE: font_size.pdf; Command '['/Volumes/data/b/build/slave/mac_xfa/build/pdfium/out/Debug/pdfium_diff', '/Volumes/data/b/build/slave/mac_xfa/build/pdfium/testing/resources/pixel/font_size_expected.pdf.0.png', '/Volumes/data/b/build/slave/mac_xfa/build/pdfium/out/Debug/gen/pdfium/testing/pixel/font_size.pdf.0.png']' returned non-zero exit status 1 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1410743008 .
2015-11-03Return result of the test runner.Dan Sinclair
We need to actually return the result of the test runner.... R=thestig@chromium.org Review URL: https://codereview.chromium.org/1413863011 .
2015-11-03One test runner to rule them all.Dan Sinclair
This CL takes the three test runners (corpus, javascript, pixel) and combines the code into a single test_runner file. Each of the individual runners still exists and calls the test runner with their data directory. With this change, the pixel and javascript test will now run in parallel if multiple processors are available. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1430623006 .
2015-11-02Support linearized loadingJun Fang
BUG=446715 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1353093003 .
2015-10-28Allow running individual tests.Dan Sinclair
This CL adds the ability to run a given test from the corpus, javascript and pixel test runners. The filename to provide is relative to the testing directory in question. Because the directories for javascript and pixel are flat you just provide the filename (it will rewrite the .pdf to .in if .pdf is provided). For corpus tests you have to provide the path from the corpus directory. Development/pdfium/pdfium % ./testing/tools/run_javascript_tests.py apply.pdf Rendering PDF file /Development/pdfium/pdfium/out/Debug/gen/pdfium/testing/javascript/apply.pdf. Non-linearized path... Rendered 1 pages. Skipped 0 bad pages. Development/pdfium/pdfium % ./testing/tools/run_pixel_tests.py bug_524043_1.pdf Rendering PDF file /Development/pdfium/pdfium/out/Debug/gen/pdfium/testing/pixel/bug_524043_1.pdf. Linearized path... Rendered 1 pages. Skipped 0 bad pages. Checking /Development/pdfium/pdfium/out/Debug/gen/pdfium/testing/pixel/bug_524043_1.pdf.0.png diff: 0.00% passed Development/pdfium/pdfium % ./testing/tools/run_corpus_tests.py third_party/tcpdf/example_065.pdf Rendering PDF file /Development/pdfium/pdfium/out/Debug/gen/pdfium/testing/corpus/example_065.pdf. Non-linearized path... Rendered 1 pages. Skipped 0 bad pages. Checking /Development/pdfium/pdfium/out/Debug/gen/pdfium/testing/corpus/example_065.pdf.0.png diff: 0.14% failed FAILURE: example_065.pdf; Command '['/Development/pdfium/pdfium/out/Debug/pdfium_diff', '/Development/pdfium/pdfium/testing/corpus/third_party/tcpdf/example_065_expected.pdf.0.png', '/Development/pdfium/pdfium/out/Debug/gen/pdfium/testing/corpus/example_065.pdf.0.png']' returned non-zero exit status 1 Summary of Failures: /Development/pdfium/pdfium/testing/corpus/third_party/tcpdf/example_065.pdf R=thestig@chromium.org Review URL: https://codereview.chromium.org/1407913005 .
2015-10-28Check if document was opened during testing.Dan Sinclair
When we call OpenDocument we fail to check if the document was actually opened. Currently we return true in all cases (assuming we read the file). This CL updates the code to check if the document was opened and return false if not. I've updated several tests to check for FALSE instead of TRUE. I verified the documents in fact don't open with my local (non-PDFium) PDF reader. BUG=pdfium:223 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1417893007 .
2015-10-27Type check the m_pShadingObj before assuming it's a stream.Dan Sinclair
The m_pShadingObj can be a stream or a dictionary depending on how it's used. This CL adds some simple type checking to make sure that the type of the object matches what we expect. BUG=chromium:547706 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1421973004 .
2015-10-26Revert "Make m_pShadingObj a CPDF_Stream instead of CPDF_Object."Dan Sinclair
There appear to be a bunch of corpus tests which fail with this change such as FAILURE: shading1.pdf This reverts commit 85361b227ad6786d2aeef8409b79a8d077a26ee9. Make m_pShadingObj a CPDF_Stream instead of CPDF_Object. This object is required to be a stream and was being converted as such. With the new type checking this caused us to pass a nullptr where previously we'd have, incorrectly, cast a CPDF_Dictionary to a CPDF_Stream. This CL changes the m_pShadingObj to always be a CPDF_Stream. Then, we never go down the bad code path because we check if m_pShadingObj is nullptr earlier and bail out. BUG=chromium:547706 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1414283003 .
2015-10-26Make m_pShadingObj a CPDF_Stream instead of CPDF_Object.Dan Sinclair
This object is required to be a stream and was being converted as such. With the new type checking this caused us to pass a nullptr where previously we'd have, incorrectly, cast a CPDF_Dictionary to a CPDF_Stream. This CL changes the m_pShadingObj to always be a CPDF_Stream. Then, we never go down the bad code path because we check if m_pShadingObj is nullptr earlier and bail out. BUG=chromium:547706 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1426713002 .
2015-10-22Set a recursion limit on CPDF_DataAvail::CheckPageNodeOliver Chang
This limit mirrors FX_MAX_PAGE_LEVEL in fpdf_parser_document.cpp R=thestig@chromium.org, tsepez@chromium.org BUG=544880 Review URL: https://codereview.chromium.org/1421743003 .
2015-10-22Make parallelized run_corpus_tests.py handle ctrl-c.Lei Zhang
Thanks Stack Overflow! R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1421623002 .
2015-10-19Consolidate test support code.Tom Sepez
Removes duplication between pdfium_test and pdfium_embeddertest R=thestig@chromium.org Review URL: https://codereview.chromium.org/1416713002 .
2015-10-16DEPS include_rules no longer allows core/ -> fpsdfsk/ inclusion.Tom Sepez
Adds the following new violations: ERROR in core/include/fpdfapi/fpdf_parser.h Illegal include: "public/fpdfview.h" ERROR in core/include/fpdfapi/fpdf_render.h Illegal include: "public/fpdf_progressive.h" ERROR in core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp Illegal include: "public/fpdfview.h" BUG=pdfium:217 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1411493002 .
2015-10-16Loosen checking on the bytes following 'stream'chromium/2540chromium/2539chromium/2538Jun Fang
PDF specs say that end of line markers shall follow the keyword "stream". But a white space before end of line markers follows this keyword in the test pdf files. BUG=543018 R=thestig@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1401923005 .
2015-10-14Add unit test for top-level bookmarks.Tom Sepez
Null FPDF_BOOKMARK represents the "root" bookmark, and must not segv when asking about titles or children. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1404723002 .
2015-10-09Parallelize run_corpus_tests.py.Lei Zhang
- Use the number of cores as the default -j value - Fall back to old code for -j 1 R=nparker@chromium.org Review URL: https://codereview.chromium.org/1398793003 .
2015-10-09Allow compiling PDFium without V8.Tom Sepez
Original patch from issue 1391843004 at patchset 1 (http://crrev.com/1391843004#ps1) Introduce a pdf_enable_v8 GYP variable, which controls a corresponding PDF_ENABLE_V8 #define, and bring in the real JS library when set. Otherwise, link against a stub JS runtime. BUG=pdfium:211 R=dml@google.com, jochen@chromium.org, thestig@chromium.org Review URL: https://codereview.chromium.org/1395733006 .
2015-10-06Run FXJS_V8 embedder tests against a shared isolate.Tom Sepez
Start to back-fill some tests for the recent isolate work. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1377293004 .
2015-10-02Correct mistakes in test case for 507316Tom Sepez
Original patch by chamalsl. Trailer size in bug_507316 was wrong. embedder_test.cpp's GetPageTrampoline passed null parameter. It will affect future test cases even if it does not affect this. BUG=507316 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1377403003 .
2015-09-30Add signatures to FXJS_V8.Tom Sepez
BUG=chromium:529012 R=jochen@chromium.org, krasin@google.com Review URL: https://codereview.chromium.org/1353193004 .
2015-09-29Fix blank page issue caused by too strict correction on bpcchromium/2523Jun Fang
For bit per component (bpc), PDF spec mentions that a RunLengthDecode or DCTDecode filter shall always deliver 8-bit samples. However, some PDF files don't follow this rule. We can find that filter is RunLengthDecode but bpc is 1 in the provided test file. In this case, pdfium will correct bpc to 8 but the actual bpc is 1. It causes a failure because the data is much more than the expected. To handle this case, pdfium doesn't correct bpc to 8 when the original bpc is 1. BUG=512557 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1328213002 .
2015-09-28Fix test diff caused by v8 version updateTom Sepez
Also changes DEPS to specify a specific v8 version, this will require us to manually update this version from time to time, but also solves a longstanding problem where going back to an older version (say for bisecting) wouldn't always work. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1372963003 .
2015-09-25Add Mac-specific pixel test expectations.chromium/2522chromium/2521Lei Zhang
The font is slightly different from Linux/Windows. BUG=524043 R=jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/1366363002 .
2015-09-25Revert "Revert "Fix the issue that pdfium swallows 'fi' or 'ff' in some pdf ↵Jun Fang
files"" This reverts commit fa9756f77ad6145940d3dc697814b84f5755ae17. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1307353005/
2015-09-25Revert "Fix the issue that pdfium swallows 'fi' or 'ff' in some pdf files"Jun Fang
This reverts commit 9bd18183ba8210c91d71c3060146235750a4c71c.
2015-09-25Fix the issue that pdfium swallows 'fi' or 'ff' in some pdf filesJun Fang
Pdfium swallows 'fi' or 'ff' in some tested files because it doesn't load the embedded font file correctly. The root cause is that there is incorrect keyword like 'ngendstream' in the stream of the embedded font file. Pdfium tries to find another correct keyword but uses wrong offset rather than accumulated offset. BUG=524043 R=thestig@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1307353005 .
2015-09-15Implement FPDFAction_GetFilePath().Lei Zhang
The API is the same as the Foxit version, except the encoding is specified as UTF-8 instead of local encoding. Also remove CPDF_LWinParam since it's unused. BUG=chromium:517713 R=jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/1335373002 .
2015-09-11Fix strings, remove stringify macros, void return types for Consts.h.Tom Sepez
Replace multiple #defines of the same strings with externs. Fix strings mangled by interaction of # and clang-format. Remove macros as possible. Make more JS_ functions void and simplify. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1342433002 .
2015-09-10Guard against null image data in CJBig2_GRRDProc.chromium/2509chromium/2508Lei Zhang
Credit to karl at skomski.com for the initial version of the CL. BUG=527174 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1305033006 .
2015-09-09Remove existing generated images before running a test.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1314443007 .
2015-09-09Fix heap use after free in CPDFSDK_Annot::GetPDFAnnot.Tom Sepez
Use two seperate loops to kill current focus annot and to release annots in current page. Loop to kill current focus annot is run first, so it will not access deleted annots. BUG=507316 R=tsepez@chromium.org TEST=Reproduction steps mentioned in issue 507316 should not crash chrome. Unit test added to pdfium. Run pdfium_embeddertests.exe. Review URL: https://codereview.chromium.org/1312313006 .
2015-09-09Test files for issue 507316Tom Sepez
Upload pdf test files for codereview 1312313006. BUG=507316 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1325533004 .
2015-09-08Beef up app_props.in and tidy app.cpp.Tom Sepez
Some of the values returned are dubious; capture the current state of affairs. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1317393003 .
2015-09-08Change the JS app.viewerType() return value to "pdfium"Lei Zhang
BUG=pdfium:181 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1331633002 .
2015-09-02Change fixup_pdf_template.py to open files in binary mode.Lei Zhang
Fix for the pixel test failure on Windows from commit 870b5b6793fa. Seems to work for me on Windows. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1312493006 .
2015-09-02Reapply Foxit's libopenjpeg modifications.Lei Zhang
They were lost in commit d53e6fd. BUG=pdfium:168 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1196523002 .
2015-08-31Fix two issues shown by bug 489995Tom Sepez
- Handle NULL in buffer operator<< under JS mailForm() calls. - Ensure correct type in JS addIcon() calls. BUG=489995 R=brucedawson@chromium.org, thestig@chromium.org Review URL: https://codereview.chromium.org/1327473002 .
2015-08-13Revert "Allow external font-path configuration from pdfium_test."Tom Sepez
This reverts commit d8b5e73d8609b74e6a995ee1768d20d47bd4b089. Broke corpus tests TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1292153002 .
2015-08-13Allow external font-path configuration from pdfium_test.Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1268323004 .
2015-08-04Add a license header for testing/tools/make_expected.sh.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1259963005 .
2015-08-04clang-format all pdfium code.Nico Weber
No behavior change. Generated by: find . -name '*.cpp' -o -name '*.h' | \ grep -E -v 'third_party|thirdparties|lpng_v163' | \ xargs ../../buildtools/mac/clang-format -i See thread "tabs vs spaces" on pdfium@googlegroups.com for discussion. BUG=none R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1265503005 .
2015-07-30Add simple script to regenerate expected results.Tom Sepez
(I've been doing this by hand for far too long). R=thestig@chromium.org Review URL: https://codereview.chromium.org/1264873005 .
2015-07-30Re-enable successful tests.Tom Sepez
TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1258203005 .
2015-07-30New suppressions for bundled freetypeTom Sepez
TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1255933006 .
2015-07-23document.delay and document.external are boolean properties.Tom Sepez
This is the javascript test failure at 320b2313d198. The spec says they are booleans, not ints, so correct the behaviour now. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1242263010 .
2015-07-16Fix typo from commit d3611f.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1242493003 .
2015-07-16Sort unexpected test results.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1232203003 .
2015-07-15Flip the shut down order in tests.Lei Zhang
This matches the Chromium PDF plugin changes in https://codereview.chromium.org/1230313006/ R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1237233006 .