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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 FPDF_FILEACCESS file_access_; | 117 FPDF_FILEACCESS file_access_; |
117 FX_FILEAVAIL file_avail_; | 118 FX_FILEAVAIL file_avail_; |
118 #ifdef PDF_ENABLE_V8 | 119 #ifdef PDF_ENABLE_V8 |
119 v8::Platform* platform_; | 120 v8::Platform* platform_; |
120 v8::StartupData natives_; | 121 v8::StartupData natives_; |
121 v8::StartupData snapshot_; | 122 v8::StartupData snapshot_; |
122 #endif // PDF_ENABLE_V8 | 123 #endif // PDF_ENABLE_V8 |
123 void* external_isolate_; | 124 void* external_isolate_; |
124 TestLoader* loader_; | 125 TestLoader* loader_; |
125 size_t file_length_; | 126 size_t file_length_; |
126 char* file_contents_; | 127 std::unique_ptr<char, pdfium::FreeDeleter> file_contents_; |
127 | 128 |
128 private: | 129 private: |
129 static void UnsupportedHandlerTrampoline(UNSUPPORT_INFO*, int type); | 130 static void UnsupportedHandlerTrampoline(UNSUPPORT_INFO*, int type); |
130 static int AlertTrampoline(IPDF_JSPLATFORM* plaform, | 131 static int AlertTrampoline(IPDF_JSPLATFORM* plaform, |
131 FPDF_WIDESTRING message, | 132 FPDF_WIDESTRING message, |
132 FPDF_WIDESTRING title, | 133 FPDF_WIDESTRING title, |
133 int type, | 134 int type, |
134 int icon); | 135 int icon); |
135 static int SetTimerTrampoline(FPDF_FORMFILLINFO* info, | 136 static int SetTimerTrampoline(FPDF_FORMFILLINFO* info, |
136 int msecs, | 137 int msecs, |
137 TimerCallback fn); | 138 TimerCallback fn); |
138 static void KillTimerTrampoline(FPDF_FORMFILLINFO* info, int id); | 139 static void KillTimerTrampoline(FPDF_FORMFILLINFO* info, int id); |
139 static FPDF_PAGE GetPageTrampoline(FPDF_FORMFILLINFO* info, | 140 static FPDF_PAGE GetPageTrampoline(FPDF_FORMFILLINFO* info, |
140 FPDF_DOCUMENT document, | 141 FPDF_DOCUMENT document, |
141 int page_index); | 142 int page_index); |
142 }; | 143 }; |
143 | 144 |
144 #endif // TESTING_EMBEDDER_TEST_H_ | 145 #endif // TESTING_EMBEDDER_TEST_H_ |
OLD | NEW |