OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef TESTING_PDFIUM_TEST_EMBEDDER_H_ | |
6 #define TESTING_PDFIUM_TEST_EMBEDDER_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "../core/include/fxcrt/fx_system.h" | |
11 #include "../fpdfsdk/include/fpdf_dataavail.h" | |
12 #include "../fpdfsdk/include/fpdfformfill.h" | |
13 #include "../fpdfsdk/include/fpdfview.h" | |
14 #include "testing/gtest/include/gtest/gtest.h" | |
15 #include "v8/include/v8.h" | |
16 | |
17 class PDFiumTestEmbedder : public ::testing::Test { | |
jam
2015/01/13 19:21:18
nit: add documentation about what this class is us
Tom Sepez
2015/01/15 21:24:40
Done.
| |
18 public: | |
19 PDFiumTestEmbedder() : | |
20 document_(nullptr), | |
21 avail_(nullptr), | |
22 file_length_(0), | |
23 file_contents_(nullptr) { | |
24 memset(&hints_, '\0', sizeof(hints_)); | |
25 memset(&file_access_, '\0', sizeof(file_access_)); | |
26 memset(&file_avail_, '\0', sizeof(file_avail_)); | |
27 } | |
28 | |
29 virtual ~PDFiumTestEmbedder() { } | |
30 | |
31 void SetUp() override; | |
32 void TearDown() override; | |
33 | |
34 FPDF_DOCUMENT document() { return document_; } | |
35 | |
36 virtual bool OpenDocument(const std::string& filename); | |
jam
2015/01/13 19:21:18
nit: add documentation for these methods
Tom Sepez
2015/01/15 21:24:40
Done.
| |
37 virtual FPDF_FORMHANDLE SetFormFillEnvironment(); | |
38 virtual void ClearFormFillEnvironment(FPDF_FORMHANDLE form); | |
39 virtual void DoOpenActions(FPDF_FORMHANDLE form); | |
40 virtual int GetFirstPageNum(); | |
41 virtual int GetPageCount(); | |
42 virtual FPDF_PAGE LoadPage(int page_number, FPDF_FORMHANDLE form); | |
43 virtual FPDF_BITMAP RenderPage(FPDF_PAGE page, FPDF_FORMHANDLE form); | |
44 virtual void UnloadPage(FPDF_PAGE page, FPDF_FORMHANDLE form); | |
45 | |
46 private: | |
47 FPDF_DOCUMENT document_; | |
48 FPDF_AVAIL avail_; | |
49 FX_DOWNLOADHINTS hints_; | |
50 FPDF_FILEACCESS file_access_; | |
51 FX_FILEAVAIL file_avail_; | |
52 v8::StartupData natives_; | |
53 v8::StartupData snapshot_; | |
54 size_t file_length_; | |
55 char* file_contents_; | |
56 }; | |
57 | |
58 #endif // TESTING_PDFIUM_TEST_EMBEDDER_H_ | |
59 | |
OLD | NEW |