summaryrefslogtreecommitdiff
path: root/testing/test_support.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-01-07 12:14:49 -0800
committerTom Sepez <tsepez@chromium.org>2016-01-07 12:14:49 -0800
commit5dc13d7858f9caf58b0e12f38823300a739302e2 (patch)
treef883ae2b246af537f8851b49b6f1a5eefae61800 /testing/test_support.h
parenta462162a76b3f487e76d8cc1b1f917f0937ea040 (diff)
downloadpdfium-5dc13d7858f9caf58b0e12f38823300a739302e2.tar.xz
Disentangle fpdfsave_embeddertest's FPDF_FILEWRITE, use gmock matchers.
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1561303002 .
Diffstat (limited to 'testing/test_support.h')
-rw-r--r--testing/test_support.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/testing/test_support.h b/testing/test_support.h
index 945704194d..f59d5440e7 100644
--- a/testing/test_support.h
+++ b/testing/test_support.h
@@ -10,6 +10,7 @@
#include <string>
#include "public/fpdfview.h"
+#include "public/fpdf_save.h"
#ifdef PDF_ENABLE_V8
#include "v8/include/v8.h"
@@ -62,4 +63,19 @@ class TestLoader {
const size_t m_Len;
};
+class TestSaver : public FPDF_FILEWRITE {
+ public:
+ TestSaver();
+
+ void ClearString();
+ const std::string& GetString() const { return m_String; }
+
+ private:
+ static int WriteBlockCallback(FPDF_FILEWRITE* pFileWrite,
+ const void* data,
+ unsigned long size);
+
+ std::string m_String;
+};
+
#endif // TESTING_EMBEDDER_TEST_SUPPORT_H_