summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js/cxfa_fm2jscontext_embeddertest.cpp
AgeCommit message (Collapse)Author
2017-06-29Cleanup call expression handling in fm2jsRyan Harrison
Remove handling of arbitrary function calls, and only allow supported function calls. Issues with the lexer being overly permissive led to large blobs of javascript being dropped into the output. Specifically driver code was assuming that anything marked as a function would just be an identifier that could be inserted into the javascript, but the lexer marks things like ()()() as a function, which would lead to the following JS being inserted as an identifier. This change is intended to be a patch for the specific issue that was being seen from the fuzzer test, and further work will be needed to make the lexer more strict. BUG=724913 TEST=Ran fuzzer test case. Ran unittests,embeddertests,corpustests. Change-Id: Ib7d9239bf6fece853bea0f4915ee4ad72d3cd290 Reviewed-on: https://pdfium-review.googlesource.com/7032 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-06-28XFA: Add test to show Oneof() works correctly.Lei Zhang
The new embedder test shows Oneof() works, whereas the corpus test does not. It turns out the corpus test was bad, and trying to fix it exposed a different bug. So roll DEPS for the testing corpus anyway to get improved tests, but keep the suppression for now. BUG=pdfium:781 Change-Id: I3cc6b9a414384c917f205eff064c5dd2175d09fe Reviewed-on: https://pdfium-review.googlesource.com/6973 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-05-25Fix FM2JSContext Round return typeDan Sinclair
This Cl fixes the return type of the Round method to return a double instead of a string. Change-Id: I740e375bdedfe22cb9f81d4beeaa079eac64b1bd Reviewed-on: https://pdfium-review.googlesource.com/5896 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-05-25Enable remaining boolean FM2JSContext testsdan sinclair
This CL updates the return type of the remaining boolean tests to be Integer and enables the tests. Change-Id: Ie2856ad31d17ffb496f33e6969912d0aae9678c5 Reviewed-on: https://pdfium-review.googlesource.com/5895 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-05-25Enable the FM2JSContext Exists testdan sinclair
This Cl fixes the Exists test of FM2JSContext to handle the return type of Integer instead of Boolean. Change-Id: I51c43e22eff5330de5ab5e63a925006af483f0ab Reviewed-on: https://pdfium-review.googlesource.com/5894 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-05-25Enable FM2JSContext Choose testsdan sinclair
This Cl enables the Choose tests for FM2JSContext. The Choose tests always return a String. Change-Id: I29b3ce4ed38f94886c6036f3766182fecb6e787b Reviewed-on: https://pdfium-review.googlesource.com/5893 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-05-25Enable most FM2JSContext boolean testsdan sinclair
This CL enables most of the FM2JSContext boolean tests. The return type is updated to Integer from Boolean. Change-Id: Ie3f665bd23a86e843cadb2ae8963767466bd1714 Reviewed-on: https://pdfium-review.googlesource.com/5892 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-05-24More FM2JSContext testsDan Sinclair
This CL adds tests for the FormCalc methods that don't require passing in a formcalc object reference. Change-Id: Ica6f15704cce525d38d25a27d1628089d2fc5a5a Reviewed-on: https://pdfium-review.googlesource.com/5691 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-05-18Adding fm2js embedder testsDan Sinclair
This Cl adds the basis of the test framework to execute the javascript produced by CXFA_FM2JSContext and verify the results are correct. Change-Id: Ie46625b7e27ca0808e9cc41fdc00b7c0a212837d Reviewed-on: https://pdfium-review.googlesource.com/5651 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>