summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdfformfill_embeddertest.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-06-02 16:51:07 -0700
committerTom Sepez <tsepez@chromium.org>2015-06-02 16:51:07 -0700
commita76f557650dfc95cae5f535d4a1b627a84d2b5f0 (patch)
tree40de9a298f1e02774dcb6cfb303d629bc97a7ec4 /fpdfsdk/src/fpdfformfill_embeddertest.cpp
parentb29338d126125d96d63817af1d80a64ea929ffae (diff)
downloadpdfium-a76f557650dfc95cae5f535d4a1b627a84d2b5f0.tar.xz
Automated test case for 487928.
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
Diffstat (limited to 'fpdfsdk/src/fpdfformfill_embeddertest.cpp')
-rw-r--r--fpdfsdk/src/fpdfformfill_embeddertest.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/fpdfsdk/src/fpdfformfill_embeddertest.cpp b/fpdfsdk/src/fpdfformfill_embeddertest.cpp
index b4cc111a00..615ada99f9 100644
--- a/fpdfsdk/src/fpdfformfill_embeddertest.cpp
+++ b/fpdfsdk/src/fpdfformfill_embeddertest.cpp
@@ -6,6 +6,7 @@
#include "../../public/fpdf_formfill.h"
#include "../../testing/embedder_test.h"
#include "../../testing/embedder_test_mock_delegate.h"
+#include "../../testing/embedder_test_timer_handling_delegate.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -19,6 +20,8 @@ TEST_F(FPDFFormFillEmbeddertest, FirstTest) {
EmbedderTestMockDelegate mock;
EXPECT_CALL(mock, Alert(_, _, _, _)).Times(0);
EXPECT_CALL(mock, UnsupportedHandler(_)).Times(0);
+ EXPECT_CALL(mock, SetTimer(_, _)).Times(0);
+ EXPECT_CALL(mock, KillTimer(_)).Times(0);
SetDelegate(&mock);
EXPECT_TRUE(OpenDocument("testing/resources/hello_world.pdf"));
@@ -26,3 +29,15 @@ TEST_F(FPDFFormFillEmbeddertest, FirstTest) {
EXPECT_NE(nullptr, page);
UnloadPage(page);
}
+
+TEST_F(FPDFFormFillEmbeddertest, BUG_487928) {
+ EmbedderTestTimerHandlingDelegate delegate;
+ SetDelegate(&delegate);
+
+ EXPECT_TRUE(OpenDocument("testing/resources/bug_487928.pdf"));
+ FPDF_PAGE page = LoadPage(0);
+ EXPECT_NE(nullptr, page);
+ DoOpenActions();
+ delegate.AdvanceTime(5000);
+ UnloadPage(page);
+}