OLD | NEW |
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 <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "public/fpdf_dataavail.h" | 12 #include "public/fpdf_dataavail.h" |
13 #include "public/fpdf_ext.h" | 13 #include "public/fpdf_ext.h" |
14 #include "public/fpdf_formfill.h" | 14 #include "public/fpdf_formfill.h" |
15 #include "public/fpdfview.h" | 15 #include "public/fpdfview.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 #include "testing/test_support.h" |
17 | 18 |
18 #ifdef PDF_ENABLE_V8 | 19 #ifdef PDF_ENABLE_V8 |
19 #include "v8/include/v8.h" | 20 #include "v8/include/v8.h" |
20 #endif // PDF_ENABLE_v8 | 21 #endif // PDF_ENABLE_v8 |
21 | 22 |
22 class TestLoader; | 23 class TestLoader; |
23 | 24 |
24 // This class is used to load a PDF document, and then run programatic | 25 // This class is used to load a PDF document, and then run programatic |
25 // API tests against it. | 26 // API tests against it. |
26 class EmbedderTest : public ::testing::Test, | 27 class EmbedderTest : public ::testing::Test, |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 FPDF_FILEACCESS file_access_; | 123 FPDF_FILEACCESS file_access_; |
123 FX_FILEAVAIL file_avail_; | 124 FX_FILEAVAIL file_avail_; |
124 #ifdef PDF_ENABLE_V8 | 125 #ifdef PDF_ENABLE_V8 |
125 v8::Platform* platform_; | 126 v8::Platform* platform_; |
126 v8::StartupData natives_; | 127 v8::StartupData natives_; |
127 v8::StartupData snapshot_; | 128 v8::StartupData snapshot_; |
128 #endif // PDF_ENABLE_V8 | 129 #endif // PDF_ENABLE_V8 |
129 void* external_isolate_; | 130 void* external_isolate_; |
130 TestLoader* loader_; | 131 TestLoader* loader_; |
131 size_t file_length_; | 132 size_t file_length_; |
132 char* file_contents_; | 133 std::unique_ptr<char, pdfium::FreeDeleter> file_contents_; |
133 | 134 |
134 private: | 135 private: |
135 static void UnsupportedHandlerTrampoline(UNSUPPORT_INFO*, int type); | 136 static void UnsupportedHandlerTrampoline(UNSUPPORT_INFO*, int type); |
136 static int AlertTrampoline(IPDF_JSPLATFORM* plaform, | 137 static int AlertTrampoline(IPDF_JSPLATFORM* plaform, |
137 FPDF_WIDESTRING message, | 138 FPDF_WIDESTRING message, |
138 FPDF_WIDESTRING title, | 139 FPDF_WIDESTRING title, |
139 int type, | 140 int type, |
140 int icon); | 141 int icon); |
141 static int SetTimerTrampoline(FPDF_FORMFILLINFO* info, | 142 static int SetTimerTrampoline(FPDF_FORMFILLINFO* info, |
142 int msecs, | 143 int msecs, |
143 TimerCallback fn); | 144 TimerCallback fn); |
144 static void KillTimerTrampoline(FPDF_FORMFILLINFO* info, int id); | 145 static void KillTimerTrampoline(FPDF_FORMFILLINFO* info, int id); |
145 static FPDF_PAGE GetPageTrampoline(FPDF_FORMFILLINFO* info, | 146 static FPDF_PAGE GetPageTrampoline(FPDF_FORMFILLINFO* info, |
146 FPDF_DOCUMENT document, | 147 FPDF_DOCUMENT document, |
147 int page_index); | 148 int page_index); |
148 }; | 149 }; |
149 | 150 |
150 #endif // TESTING_EMBEDDER_TEST_H_ | 151 #endif // TESTING_EMBEDDER_TEST_H_ |
OLD | NEW |