summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdfview_embeddertest.cpp
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-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-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-26Fix infinite recursion in CPDF_Parser::ParseIndirectObjectAt().Tom Sepez
A suitably corrupted file can cause the parser(s) to repeatedly re-read sections of the file at increasing parser recursion depth until the stack is exhausted. There is supposed to be a check for this based upon the parser "level", but not all call paths pass or update the level as required. Much as I hate per-class statics, this introduces one to track the depth so that the check is enforced no matter how screwy the call path might be that leads the parser to re-enter itself. This is more palatable than trying to find all these paths and fix them. We know this is OK since there is only one thread in here modifying the static. BUG=451830 R=thestig@chromium.org Review URL: https://codereview.chromium.org/875263002
2015-01-22Add API tests: NamedDestsByName, DestGetPageIndex.Tom Sepez
This also adds a fpdfdoc_embeddertest.cpp to keep the test file name matching with the API call under test. R=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/812933004
2015-01-21Add tests for GetNamedDests() API.Tom Sepez
Follow-on work from patch at https://codereview.chromium.org/845643008. This incorporates that patch, plus adds tests for it and similar conditions. A few changes are introduced to correct expected behaviour. This also incoprorates Deepak's fix in https://codereview.chromium.org/845643008/ This incorporates a formerly unlanded tool to generate small valid PDF files from template input, which is needed to cover all the error cases here. See https://codereview.chromium.org/791993006/ BUG=450133 R=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/837723009
2015-01-16Follow-on to pdfium_embeddertests.Tom Sepez
This includes: - Fix TestLoader lifetime. - Rename test file to match the equivalent .cpp under test - Re-organize a few tests to avoid duplicate loading - add tests for a few additional functions. R=jam@chromium.org Review URL: https://codereview.chromium.org/857483005