Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: testing/embedder_test.h

Issue 1546063002: Add tests to exercise FPDF_SaveAsCopy(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 PDFium Authors. All rights reserved. 1 // Copyright 2015 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef TESTING_EMBEDDER_TEST_H_ 5 #ifndef TESTING_EMBEDDER_TEST_H_
6 #define TESTING_EMBEDDER_TEST_H_ 6 #define TESTING_EMBEDDER_TEST_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 // Equivalent to FPDF_FORMFILLINFO::FFI_GetPage(). 52 // Equivalent to FPDF_FORMFILLINFO::FFI_GetPage().
53 virtual FPDF_PAGE GetPage(FPDF_FORMHANDLE form_handle, 53 virtual FPDF_PAGE GetPage(FPDF_FORMHANDLE form_handle,
54 FPDF_DOCUMENT document, 54 FPDF_DOCUMENT document,
55 int page_index); 55 int page_index);
56 56
57 private: 57 private:
58 std::map<int, FPDF_PAGE> m_pageMap; 58 std::map<int, FPDF_PAGE> m_pageMap;
59 }; 59 };
60 60
61 struct LoadDocumentData {
62 FPDF_DOCUMENT* document;
63 FPDF_FILEACCESS* file_access;
64 FX_FILEAVAIL* file_avail;
65 FPDF_AVAIL* avail;
66 FX_DOWNLOADHINTS* hints;
67 FPDF_FORMHANDLE* form_handle;
68 };
69
61 EmbedderTest(); 70 EmbedderTest();
62 virtual ~EmbedderTest(); 71 virtual ~EmbedderTest();
63 72
73 static bool LoadDocument(const char* data,
74 size_t data_size,
75 bool must_linearize,
76 TestLoader* loader,
77 EmbedderTest* embedder_test,
78 LoadDocumentData* out_data);
79
64 void SetUp() override; 80 void SetUp() override;
65 void TearDown() override; 81 void TearDown() override;
66 82
67 #ifdef PDF_ENABLE_V8 83 #ifdef PDF_ENABLE_V8
68 // Call before SetUp to pass shared isolate, otherwise PDFium creates one. 84 // Call before SetUp to pass shared isolate, otherwise PDFium creates one.
69 void SetExternalIsolate(void* isolate) { 85 void SetExternalIsolate(void* isolate) {
70 external_isolate_ = static_cast<v8::Isolate*>(isolate); 86 external_isolate_ = static_cast<v8::Isolate*>(isolate);
71 } 87 }
72 #endif // PDF_ENABLE_V8 88 #endif // PDF_ENABLE_V8
73 89
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 static int SetTimerTrampoline(FPDF_FORMFILLINFO* info, 151 static int SetTimerTrampoline(FPDF_FORMFILLINFO* info,
136 int msecs, 152 int msecs,
137 TimerCallback fn); 153 TimerCallback fn);
138 static void KillTimerTrampoline(FPDF_FORMFILLINFO* info, int id); 154 static void KillTimerTrampoline(FPDF_FORMFILLINFO* info, int id);
139 static FPDF_PAGE GetPageTrampoline(FPDF_FORMFILLINFO* info, 155 static FPDF_PAGE GetPageTrampoline(FPDF_FORMFILLINFO* info,
140 FPDF_DOCUMENT document, 156 FPDF_DOCUMENT document,
141 int page_index); 157 int page_index);
142 }; 158 };
143 159
144 #endif // TESTING_EMBEDDER_TEST_H_ 160 #endif // TESTING_EMBEDDER_TEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698