diff options
author | Artem Strygin <art-snake@yandex-team.ru> | 2017-09-28 18:46:03 +0300 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-28 15:59:08 +0000 |
commit | 0e60b9ef2b79de52ef62101abae2af7292e879b7 (patch) | |
tree | 9f71519f2a364ee6702219a44de7fdb1def18cc7 /testing/embedder_test.h | |
parent | 1ca7173cd85adcd58766fc89f95c3dc163efa17a (diff) | |
download | pdfium-0e60b9ef2b79de52ef62101abae2af7292e879b7.tar.xz |
Implement FakeFileAccess.
Update embedder tests to simulate unavailable data and download requests.
Change-Id: I634fa89d2a0c859243e849752936da87568909f4
Reviewed-on: https://pdfium-review.googlesource.com/11890
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'testing/embedder_test.h')
-rw-r--r-- | testing/embedder_test.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/testing/embedder_test.h b/testing/embedder_test.h index 878e50bfdd..be89c2a6cd 100644 --- a/testing/embedder_test.h +++ b/testing/embedder_test.h @@ -14,6 +14,7 @@ #include "public/fpdf_formfill.h" #include "public/fpdf_save.h" #include "public/fpdfview.h" +#include "testing/fake_file_access.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/test_support.h" @@ -116,9 +117,7 @@ class EmbedderTest : public ::testing::Test, protected: bool OpenDocumentHelper(const char* password, bool must_linearize, - FX_FILEAVAIL* file_avail, - FX_DOWNLOADHINTS* hints, - FPDF_FILEACCESS* file_access, + FakeFileAccess* network_simulator, FPDF_DOCUMENT* document, FPDF_AVAIL* avail, FPDF_FORMHANDLE* form_handle); @@ -151,14 +150,14 @@ class EmbedderTest : public ::testing::Test, void CloseSaved(); void TestAndCloseSaved(int width, int height, const char* md5); + void SetWholeFileAvailable(); + Delegate* delegate_; std::unique_ptr<Delegate> default_delegate_; FPDF_DOCUMENT document_; FPDF_FORMHANDLE form_handle_; FPDF_AVAIL avail_; - FX_DOWNLOADHINTS hints_; - FPDF_FILEACCESS file_access_; - FX_FILEAVAIL file_avail_; + FPDF_FILEACCESS file_access_; // must outlive avail_. #ifdef PDF_ENABLE_V8 v8::Platform* platform_; #endif // PDF_ENABLE_V8 @@ -172,6 +171,10 @@ class EmbedderTest : public ::testing::Test, FPDF_PAGE m_SavedPage; FPDF_FORMHANDLE m_SavedForm; FPDF_AVAIL m_SavedAvail; + FPDF_FILEACCESS saved_file_access_; // must outlive m_SavedAvail. + std::unique_ptr<FakeFileAccess> fake_file_access_; // must outlive avail_. + std::unique_ptr<FakeFileAccess> + saved_fake_file_access_; // must outlive m_SavedAvail. private: static void UnsupportedHandlerTrampoline(UNSUPPORT_INFO*, int type); |