summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_formfill_embeddertest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/fpdf_formfill_embeddertest.cpp')
-rw-r--r--fpdfsdk/fpdf_formfill_embeddertest.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/fpdfsdk/fpdf_formfill_embeddertest.cpp b/fpdfsdk/fpdf_formfill_embeddertest.cpp
index 09e0c200d3..cedb96c0ca 100644
--- a/fpdfsdk/fpdf_formfill_embeddertest.cpp
+++ b/fpdfsdk/fpdf_formfill_embeddertest.cpp
@@ -380,6 +380,36 @@ TEST_F(FPDFFormFillEmbeddertest, BUG_514690) {
}
#ifdef PDF_ENABLE_V8
+TEST_F(FPDFFormFillEmbeddertest, DisableJavaScript) {
+ // Test that timers and intervals can't fire without JS.
+ EmbedderTestTimerHandlingDelegate delegate;
+ SetDelegate(&delegate);
+
+ EXPECT_TRUE(OpenDocumentWithoutJavaScript("bug_551248.pdf"));
+ FPDF_PAGE page = LoadPage(0);
+ EXPECT_TRUE(page);
+ DoOpenActions();
+
+ const auto& alerts = delegate.GetAlerts();
+ EXPECT_EQ(0U, alerts.size());
+
+ delegate.AdvanceTime(1000);
+ EXPECT_EQ(0U, alerts.size()); // nothing fired.
+ delegate.AdvanceTime(1000);
+ EXPECT_EQ(0U, alerts.size()); // nothing fired.
+ delegate.AdvanceTime(1000);
+ EXPECT_EQ(0U, alerts.size()); // nothing fired.
+ delegate.AdvanceTime(1000);
+ EXPECT_EQ(0U, alerts.size()); // nothing fired.
+ delegate.AdvanceTime(1000);
+ EXPECT_EQ(0U, alerts.size()); // nothing fired.
+ delegate.AdvanceTime(1000);
+ EXPECT_EQ(0U, alerts.size()); // nothing fired.
+ delegate.AdvanceTime(1000);
+ EXPECT_EQ(0U, alerts.size()); // nothing fired.
+ UnloadPage(page);
+}
+
TEST_F(FPDFFormFillEmbeddertest, BUG_551248) {
// Test that timers fire once and intervals fire repeatedly.
EmbedderTestTimerHandlingDelegate delegate;