OLD | NEW |
1 // Copyright (c) 2015 PDFium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "embedder_test.h" | 5 #include "embedder_test.h" |
6 | 6 |
7 #include <limits.h> | 7 #include <limits.h> |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 #include <string.h> | 10 #include <string.h> |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 document_ = FPDF_LoadCustomDocument(&file_access_, nullptr); | 205 document_ = FPDF_LoadCustomDocument(&file_access_, nullptr); |
206 } else { | 206 } else { |
207 document_ = FPDFAvail_GetDocument(avail_, nullptr); | 207 document_ = FPDFAvail_GetDocument(avail_, nullptr); |
208 } | 208 } |
209 | 209 |
210 (void) FPDF_GetDocPermissions(document_); | 210 (void) FPDF_GetDocPermissions(document_); |
211 (void) FPDFAvail_IsFormAvail(avail_, &hints_); | 211 (void) FPDFAvail_IsFormAvail(avail_, &hints_); |
212 | 212 |
213 IPDF_JSPLATFORM* platform = static_cast<IPDF_JSPLATFORM*>(this); | 213 IPDF_JSPLATFORM* platform = static_cast<IPDF_JSPLATFORM*>(this); |
214 memset(platform, 0, sizeof(IPDF_JSPLATFORM)); | 214 memset(platform, 0, sizeof(IPDF_JSPLATFORM)); |
215 platform->version = 1; | 215 platform->version = 2; |
216 platform->app_alert = AlertTrampoline; | 216 platform->app_alert = AlertTrampoline; |
217 | 217 |
218 FPDF_FORMFILLINFO* formfillinfo = static_cast<FPDF_FORMFILLINFO*>(this); | 218 FPDF_FORMFILLINFO* formfillinfo = static_cast<FPDF_FORMFILLINFO*>(this); |
219 memset(formfillinfo, 0, sizeof(FPDF_FORMFILLINFO)); | 219 memset(formfillinfo, 0, sizeof(FPDF_FORMFILLINFO)); |
220 formfillinfo->version = 1; | 220 formfillinfo->version = 1; |
221 formfillinfo->FFI_SetTimer = SetTimerTrampoline; | 221 formfillinfo->FFI_SetTimer = SetTimerTrampoline; |
222 formfillinfo->FFI_KillTimer = KillTimerTrampoline; | 222 formfillinfo->FFI_KillTimer = KillTimerTrampoline; |
223 formfillinfo->m_pJsPlatform = platform; | 223 formfillinfo->m_pJsPlatform = platform; |
224 | 224 |
225 form_handle_ = FPDFDOC_InitFormFillEnvironment(document_, formfillinfo); | 225 form_handle_ = FPDFDOC_InitFormFillEnvironment(document_, formfillinfo); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 } | 305 } |
306 | 306 |
307 // Can't use gtest-provided main since we need to stash the path to the | 307 // Can't use gtest-provided main since we need to stash the path to the |
308 // executable in order to find the external V8 binary data files. | 308 // executable in order to find the external V8 binary data files. |
309 int main(int argc, char** argv) { | 309 int main(int argc, char** argv) { |
310 g_exe_path_ = argv[0]; | 310 g_exe_path_ = argv[0]; |
311 testing::InitGoogleTest(&argc, argv); | 311 testing::InitGoogleTest(&argc, argv); |
312 testing::InitGoogleMock(&argc, argv); | 312 testing::InitGoogleMock(&argc, argv); |
313 return RUN_ALL_TESTS(); | 313 return RUN_ALL_TESTS(); |
314 } | 314 } |
OLD | NEW |