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