| 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 UNSUPPORT_INFO* info = static_cast<UNSUPPORT_INFO*>(this); | 163 UNSUPPORT_INFO* info = static_cast<UNSUPPORT_INFO*>(this); |
| 164 memset(info, 0, sizeof(UNSUPPORT_INFO)); | 164 memset(info, 0, sizeof(UNSUPPORT_INFO)); |
| 165 info->version = 1; | 165 info->version = 1; |
| 166 info->FSDK_UnSupport_Handler = UnsupportedHandlerTrampoline; | 166 info->FSDK_UnSupport_Handler = UnsupportedHandlerTrampoline; |
| 167 FSDK_SetUnSpObjProcessHandler(info); | 167 FSDK_SetUnSpObjProcessHandler(info); |
| 168 } | 168 } |
| 169 | 169 |
| 170 void EmbedderTest::TearDown() { | 170 void EmbedderTest::TearDown() { |
| 171 if (document_) { | 171 if (document_) { |
| 172 FORM_DoDocumentAAction(form_handle_, FPDFDOC_AACTION_WC); | 172 FORM_DoDocumentAAction(form_handle_, FPDFDOC_AACTION_WC); |
| 173 FPDFDOC_ExitFormFillEnvironment(form_handle_); |
| 173 FPDF_CloseDocument(document_); | 174 FPDF_CloseDocument(document_); |
| 174 FPDFDOC_ExitFormFillEnvironment(form_handle_); | |
| 175 } | 175 } |
| 176 FPDFAvail_Destroy(avail_); | 176 FPDFAvail_Destroy(avail_); |
| 177 FPDF_DestroyLibrary(); | 177 FPDF_DestroyLibrary(); |
| 178 v8::V8::ShutdownPlatform(); | 178 v8::V8::ShutdownPlatform(); |
| 179 delete platform_; | 179 delete platform_; |
| 180 delete loader_; | 180 delete loader_; |
| 181 free(file_contents_); | 181 free(file_contents_); |
| 182 } | 182 } |
| 183 | 183 |
| 184 bool EmbedderTest::OpenDocument(const std::string& filename) { | 184 bool EmbedderTest::OpenDocument(const std::string& filename) { |
| (...skipping 120 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 |