summaryrefslogtreecommitdiff
path: root/testing
AgeCommit message (Collapse)Author
2015-06-30Revert "Redo range check in CPDF_SampledFunc::v_Call()."Tom Sepez
This reverts commit 74742a75ac7a07c08cf36fe6f4eaa91bed8236a3.
2015-06-30Redo range check in CPDF_SampledFunc::v_Call().Tom Sepez
The current |bitpos1| calculation protects the passed argument to _GetBits32(): |bitpos.ValueOrDie() + j * m_nBitsPerSample|, but doesn't account for adding in the sample length in that routine. Also bound bits per sample to something reasonable to avoid undefined behaviour on the shift to compute the max value. BUG=471990 R=jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/1219663003.
2015-06-29Remove references to three deleted files.Bruce Dawson
The gyp-to-ninja conversion process doesn't check for missing files, so they creep in. This change deletes three files that were deleted or never added but which are referenced from .gyp files. To see warnings about deleted files (Windows only) set GYP_GENERATORS to msvs-ninja,ninja before running build\gyp_pdfium. The msvs-ninja generator warns on missing files. R=tsepez@chromium.org BUG=483424 Review URL: https://codereview.chromium.org/1201273006.
2015-06-22Fix Javascript tests after commit f55771af6429.chromium/2445chromium/2444chromium/2443chromium/2442chromium/2441chromium/2440Lei Zhang
- Return true instead of false. All the other unsupported JS functions return true. - Adjust test expectations accordingly. TBR=jam@chromium.org Review URL: https://codereview.chromium.org/1196163006.
2015-06-15Do some IWYU cleanups.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1176333002.
2015-06-12Corpus tests check for unexpected successes.Tom Sepez
Update run_corpus_tests.py to always run all test cases, and just ignore the results that are supposed to fail. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1178393002.
2015-06-02Automated test case for 487928.Tom Sepez
Reproducing this bug requires the embedder to fire timers, something the single-pass pdfium-test binary doesn't do properly at the present. So we modify the embedder test delegate to allow the immediate triggering of the same. Perform some cleanup along the way by removing EmbedderTestDefaultDelegate -- it buys us nothing over the the no-op one. And, of course, v8 initialization is busted again, and we need v8 here. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1153213004
2015-05-29Run V8 in predictable mode for pdfium_testJochen Eisinger
This won't post tasks to the background threads BUG=none R=kcc@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1157123003
2015-05-28Fix suppressions for 2015-05-28 dropTom Sepez
TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1154993003
2015-05-20Get test running scripts to detect and report common error.Bruce Dawson
testing/tools/run_corpus_tests.py assumes a debug build and will fail cryptically if only a release build is available. Arguably there shouldn't be a default because having one could lead to accidentally running a stale version, but that is probably too much of a change. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1150823003
2015-05-15Fix leaks in the embedder tests themselves.Lei Zhang
Also change EmbedderTest::TearDown() to match the destruction order in Chromium's PDF code. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1138143003
2015-05-12Make (and verify) public/ files compile under C.Tom Sepez
This involves adding some missing extern "C" { } declarations, using FPDF_ types instead of C++ types, and converting pass by reference arguments into pointers. Test this using fpdfview_embedertest for simplicity. BUG=pdfium:158 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1130843003
2015-05-11Create top-level public/ header directory.Tom Sepez
These are the only files that embedders of PDFium should be including. They are entirely self-contained, and compile cleanly against -Wall so as to not offend the code that may include them. Having done this, we can see that chromium is pulling in two additional files from the fpdfsdk/include/pdfwindow directory, which is not guaranteed to work. A few files are renamed, adding an "_" to make the names consistent. The exception is fpdfview, which is doc'd as such in the doc. Naturally, paths will need updating in a handful of files in chrome when this rolls in. BUG=pdfium:154 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1135913002
2015-04-29Add suppressions for all new failing corpus tests.Tom Sepez
TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1111393004
2015-04-29Corpus roll to pick up the 2015-04-28 Foxit drop.Tom Sepez
This will undoubtedly red up the tree, as we don't have trybots. A follow-up CL will add the suppressions required for each platform at the moment. The new suppressions in this CL are for cases where we didn't generate an expected result file (due to the issue in fx/FRC_3.5_part1/Introduction.txt). R=thestig@chromium.org Review URL: https://codereview.chromium.org/1111213005
2015-04-27SEGV in CFX_BaseSegmentedArray::Iterate() when CS has malformed dictionary.Tom Sepez
Failure to check document-controlled value before using it. BUG=481363 R=palmer@chromium.org, thestig@chromium.org Review URL: https://codereview.chromium.org/1110653002
2015-04-23Remove unused nParamNum values from JS method tables.Tom Sepez
The code to validate the number of parameters happens inside each particular method, rather than prior to method dispatch. As such, there's no point in having this number take up space in the table. Add some test to cover at least some of the per-method validations, and update error messages to be more useful. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1084183008
2015-04-09Consider platform-specific expected .png files.Tom Sepez
Rolls DEPS to pull in the first windows-specific .png files, and unsupresses the corresponding tests. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1072613003
2015-04-03Refactor PDFium python test utilities.Tom Sepez
Extract a common portions for determining suppressions and comparing pngs. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1057983003
2015-04-03Add embedder test comparing with the last patch.JUN FANG
When there is a wrong keyword like '??ze' in the dictionary of the trailer, PDFium can't recognize it and aborts further parsing. After this change, PDFium continues even it can't get the right size at this moment. It will rebuild the cross reference table later since the size of the table is missing. BUG=459580 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1055323003
2015-04-01Update windows suppressions and unify across platformsTom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1058463004
2015-03-26Replace linux-specific code in test scripts.Tom Sepez
Now that there's a win bot, this needs to be more careful. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1036073002
2015-03-25Suppress many failing mac tests.Tom Sepez
There's investigation required to see why there are such platform differences, but for now, a perpetually red bot isn't useful. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1002283003
2015-03-25Suppress our "pixel" test on mac since it diffs.Tom Sepez
This involves bringing some of the suppressions file mechanism into run_pixel_tests.py (making a common module would be a nice follow-up) R=thestig@chromium.org Review URL: https://codereview.chromium.org/1032923002
2015-03-25Create per-platform pdfium test suppression files.Tom Sepez
This is required now that we have win/mac bots, which may produce different outputs. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1031203003
2015-03-24Add comments to suppressions fileTom Sepez
No-op CL intended to trigger a rebuild. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1036583002
2015-03-23Support comments and blank lines in SUPPRESSIONS fileTom Sepez
The comment character is #. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1029193002
2015-03-23Create simple suppressions file in PDFium repository.Tom Sepez
This is needed to green the tree without continually reverting the pdfium_tests (corpus) repository. We will need to make this more sophisticated at some point, but for now, let's try to green the buildbot. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1016613004
2015-03-23Flush stdout before launching sub-processes.Tom Sepez
This should make the test logs more readable. Also give failure summary at end of tests, since searching through the log is tedious. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1026903002
2015-03-17Revert "TEST that the tree goes RED when pixel/javascript tests fail."Tom Sepez
This reverts commit de00893874a9d5ecae497e00511e2395fc2f02e8. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1017793003
2015-03-17TEST that the tree goes RED when pixel/javascript tests fail.Tom Sepez
This will be immediately reverted, but I need to be sure that the previous change actually detects failures. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1008873005
2015-03-17Return OS status code from python test driver scripts.Tom Sepez
Consequently, some of the tests may diff but the waterfall remains green. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1014083003
2015-03-16Pull our new test case repository via deps.Tom Sepez
Add a run_corpus_tests.py script to run pdfium_test against the corpus tree. Note that this differs from the run_pixel_tests.py script, since pre-processing is not required. I'll work on unifying these in a subsequent CL. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1010833003
2015-03-02Return error information from pdfium to JS.Tom Sepez
This implements the previously unimplemented JS_Error() function. Along the way: - fix some IWYU when the include order in global.cpp was perturbed. - remove some uses of JS_ErrorString, to increase transparency. - use vp.IsSetting() in place of !vp.IsGetting() for clarity. - specify an error string on several error return paths. - add an error string for writing readonly properties. - rename an error string constant to reflect the actual message. - replace calls to variadic Format() with a function doing string appends. - remove unused JS_GetClassName() R=thestig@chromium.org Review URL: https://codereview.chromium.org/963193003
2015-02-27Pull in gmock for standalone pdfium builds.Tom Sepez
For chromium checkouts, the top-level gmock is used instead. Verify build with a simple test that ensures neither mock method is fired. R=thestig@chromium.org Review URL: https://codereview.chromium.org/955513009
2015-02-25Implement a delegate for EmbedderTests.Tom Sepez
This is the first step in allowing an embedder test to someday gMock its callbacks, so that it can check that they fired as expected. gMock wants a class, not a C-style function-based API, and EmbedderTest is made to bridge between the two. The EmbedderTest class itself is modified to inherit from the C JS API classes themselves, to make finding the delegate easier. For example, a future embedder test might send a keystroke to a page, which would then trigger JS, which would then trigger an Alert(). Mocking the Alert() callback would allow the test to check that the alert happened as expected. R=thestig@chromium.org Review URL: https://codereview.chromium.org/960663002
2015-02-24Convert pdfium expected test results to PNG format.Tom Sepez
Required to save space vs. raw bitmap. Land prior to adding substantial number of tests. R=thestig@chromium.org Review URL: https://codereview.chromium.org/953723004
2015-02-19Add test for PDF's JS "global".Tom Sepez
Exercises a separate code path that stores some JS objects outside of JS. Needed before re-writing some other portions of the JS_Defines.h code. R=jam@chromium.org Review URL: https://codereview.chromium.org/943783002
2015-02-13Run pixel tests via automated script.Tom Sepez
On origin/master, we only have .ppm format support, so the expected output files would take up a lot of space. Hence, this may not get going until XFA hits with its .png support. Nor is there a good way to diff these; XFA provides this for .png as well. But this will provide at least one automated test to ensure that we've got non-blank output, at least for one trivially simple case. R=thestig@chromium.org Review URL: https://codereview.chromium.org/926173002
2015-02-13run_javascript_tests.py: Be more flexible about directory layout.Tom Sepez
The top-level directory name isn't part of the repository, and we can't count on it always being "pdfium" (though many people will choose to do it this way). R=jam@chromium.org Review URL: https://codereview.chromium.org/921043005
2015-02-13Test top-level Document JS properties.chromium/2313chromium/2312chromium/2310chromium/2309chromium/2308chromium/2307chromium/2306chromium/2305Tom Sepez
Along the way, I rename some functions in pdfium_test.cc to match the style guide's FunctionName() syntax, adding "Example" to make them obviously different from the PDF internal code with similar name fragments. The purpose is to at least have some coverage for the setter/getter macros from JS_Define.h R=thestig@chromium.org Review URL: https://codereview.chromium.org/928573002
2015-02-12Create run_javascript_tests.pyTom Sepez
Top level script driver for testing/resources/javascript. Converts each input template file in that directory to a .pdf file in the working directory (typically out/Debug/gen/pdfium/testing/resources/javascript), invokes pdfium_test on it to generate , and crudely diffs the expected output. We can now remove generated .pdfs from source control, keeping only the hand-editable .in templates. R=thestig@chromium.org Review URL: https://codereview.chromium.org/912803004
2015-02-10Add JavaScript test for constants in Consts.cpp.Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/908023003
2015-02-06First JavaScript testing implementation.Tom Sepez
This is a plan for testing JS inside of pdf files under pdfium: Communication of results will be done via app.alert(), rather than console.println(), since the latter is not hooked up to any API callbacks. pdfium_test.cc is modified to be more careful about use of stdout/stderr, so that only the app.alert() and the unsupported feature callback use stdout. Diffing stdout against ..._expected.txt files gives the result. I added a /javascript directory to separate these from the embeddertest resources. The alert callback is backported from XFA. This was an omission. BUG=https://code.google.com/p/pdfium/issues/detail?id=62 R=jam@chromium.org, thestig@chromium.org Review URL: https://codereview.chromium.org/872103003
2015-02-05Fix segv in CPDF_DataAvail::CheckRoot() when /Root object is a string.Tom Sepez
Handles the case of this malformed PDF without crashing. Note that to get a reproducible test case, a small fix is applied to our .py script which results in some whitespace/numbering difs across the resources (down the road, we ought to generate them on the fly in an intermediate directory). BUG=454695 R=jun_fang@foxitsoftware.com, thestig@chromium.org Review URL: https://codereview.chromium.org/895933003
2015-02-03Fix stack exhaustion in CPDF_DataAvail::HaveResourceAncestor()Tom Sepez
BUG=https://code.google.com/p/pdfium/issues/detail?id=113 R=thestig@chromium.org Review URL: https://codereview.chromium.org/880043004
2015-02-02Add embedder test for fix to bug_452455.Tom Sepez
BUG=452455 R=thestig@chromium.org Review URL: https://codereview.chromium.org/887063003
2015-01-30Track formhandles in EmbedderTest class itselfTom Sepez
This removes some duplicated code from each individual test. R=thestig@chromium.org Review URL: https://codereview.chromium.org/885403002
2015-01-29Add minimized test cases for stack exhaustion crash to repository.Tom Sepez
These reproduce under pdfium_test with a scale factor < 1.0. Add them to the repository now for the sake of posterity, even if we are not automatically testing them. BUG=451265 R=thestig@chromium.org TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/869923003
2015-01-28Merge to Master: Cover fpdftext.h API with embeddertests.Tom Sepez
Original Review URL: https://codereview.chromium.org/878333003 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/884873002