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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 UNSUPPORT_INFO unsuppored_info; | 188 UNSUPPORT_INFO unsuppored_info; |
189 memset(&unsuppored_info, '\0', sizeof(unsuppored_info)); | 189 memset(&unsuppored_info, '\0', sizeof(unsuppored_info)); |
190 unsuppored_info.version = 1; | 190 unsuppored_info.version = 1; |
191 unsuppored_info.FSDK_UnSupport_Handler = Unsupported_Handler; | 191 unsuppored_info.FSDK_UnSupport_Handler = Unsupported_Handler; |
192 FSDK_SetUnSpObjProcessHandler(&unsuppored_info); | 192 FSDK_SetUnSpObjProcessHandler(&unsuppored_info); |
193 } | 193 } |
194 | 194 |
195 void EmbedderTest::TearDown() { | 195 void EmbedderTest::TearDown() { |
196 FPDF_CloseDocument(document_); | 196 FPDF_CloseDocument(document_); |
197 FPDFAvail_Destroy(avail_); | 197 FPDFAvail_Destroy(avail_); |
| 198 FPDF_DestroyLibrary(); |
198 if (loader_) { | 199 if (loader_) { |
199 delete loader_; | 200 delete loader_; |
200 } | 201 } |
201 if (file_contents_) { | 202 if (file_contents_) { |
202 free(file_contents_); | 203 free(file_contents_); |
203 } | 204 } |
204 } | 205 } |
205 | 206 |
206 bool EmbedderTest::OpenDocument(const std::string& filename) { | 207 bool EmbedderTest::OpenDocument(const std::string& filename) { |
207 file_contents_ = GetFileContents(filename.c_str(), &file_length_); | 208 file_contents_ = GetFileContents(filename.c_str(), &file_length_); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 FPDF_RenderPageBitmap(bitmap, page, 0, 0, width, height, 0, 0); | 297 FPDF_RenderPageBitmap(bitmap, page, 0, 0, width, height, 0, 0); |
297 FPDF_FFLDraw(form, bitmap, page, 0, 0, width, height, 0, 0); | 298 FPDF_FFLDraw(form, bitmap, page, 0, 0, width, height, 0, 0); |
298 return bitmap; | 299 return bitmap; |
299 } | 300 } |
300 | 301 |
301 void EmbedderTest::UnloadPage(FPDF_PAGE page, FPDF_FORMHANDLE form) { | 302 void EmbedderTest::UnloadPage(FPDF_PAGE page, FPDF_FORMHANDLE form) { |
302 FORM_DoPageAAction(page, form, FPDFPAGE_AACTION_CLOSE); | 303 FORM_DoPageAAction(page, form, FPDFPAGE_AACTION_CLOSE); |
303 FORM_OnBeforeClosePage(page, form); | 304 FORM_OnBeforeClosePage(page, form); |
304 FPDF_ClosePage(page); | 305 FPDF_ClosePage(page); |
305 } | 306 } |
OLD | NEW |