From 0784c7317e3aaa2c65d098cf2593b6b49986307d Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 23 Apr 2018 18:02:57 +0000 Subject: Disable JavaScript entirely if no JSPlatform passed by embedder. Allows run-time selection of whether to permit JS inside PDF. Previously, this was a link-time decision only. This requires a little more caution before we decide that we have the CJS_Runtime, and not the CJS_RuntimeStub in a few casts. Adds a kDisableJavaScript option to the form fill embeddertests. Adds a --disable-javascript flag to the pdfium_test executable. Also adds a --disable-xfa flag while we're at it. Change-Id: I8d8ac95f6474459cadba9a60572fbb342e984646 Reviewed-on: https://pdfium-review.googlesource.com/31090 Reviewed-by: dsinclair Commit-Queue: Tom Sepez --- core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'core/fpdfapi') diff --git a/core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp b/core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp index df7b5b6873..4937b3d8d1 100644 --- a/core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp +++ b/core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp @@ -51,7 +51,9 @@ TEST_F(CPDFSecurityHandlerEmbeddertest, PasswordAfterGenerateSave) { const char md5[] = "a5dde3c6c37b8716b9b369a03752a728"; #endif // _FX_PLATFORM_ == _FX_PLATFORM_LINUX_ { - ASSERT_TRUE(OpenDocumentWithOptions("encrypted.pdf", "5678", true)); + ASSERT_TRUE(OpenDocumentWithOptions("encrypted.pdf", "5678", + LinearizeOption::kMustLinearize, + JavaScriptOption::kEnableJavaScript)); FPDF_PAGE page = LoadPage(0); ASSERT_TRUE(page); FPDF_PAGEOBJECT red_rect = FPDFPageObj_CreateNewRect(10, 10, 20, 20); -- cgit v1.2.3