OLD | NEW |
1 // Copyright 2015 PDFium Authors. All rights reserved. | 1 // Copyright 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 #ifndef TESTING_EMBEDDER_TEST_H_ | 5 #ifndef TESTING_EMBEDDER_TEST_H_ |
6 #define TESTING_EMBEDDER_TEST_H_ | 6 #define TESTING_EMBEDDER_TEST_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // Load a specific page of the open document. | 98 // Load a specific page of the open document. |
99 virtual FPDF_PAGE LoadPage(int page_number); | 99 virtual FPDF_PAGE LoadPage(int page_number); |
100 | 100 |
101 // Convert a loaded page into a bitmap. | 101 // Convert a loaded page into a bitmap. |
102 virtual FPDF_BITMAP RenderPage(FPDF_PAGE page); | 102 virtual FPDF_BITMAP RenderPage(FPDF_PAGE page); |
103 | 103 |
104 // Relese the resources obtained from LoadPage(). Further use of |page| | 104 // Relese the resources obtained from LoadPage(). Further use of |page| |
105 // is prohibited after this call is made. | 105 // is prohibited after this call is made. |
106 virtual void UnloadPage(FPDF_PAGE page); | 106 virtual void UnloadPage(FPDF_PAGE page); |
107 | 107 |
| 108 // Check |bitmap| to make sure it has the right dimensions and content. |
| 109 static void CompareBitmap(FPDF_BITMAP bitmap, |
| 110 int expected_width, |
| 111 int expected_height, |
| 112 const char* expected_md5sum); |
| 113 |
108 protected: | 114 protected: |
109 void SetupFormFillEnvironment(); | 115 void SetupFormFillEnvironment(); |
110 | 116 |
111 Delegate* delegate_; | 117 Delegate* delegate_; |
112 std::unique_ptr<Delegate> default_delegate_; | 118 std::unique_ptr<Delegate> default_delegate_; |
113 FPDF_DOCUMENT document_; | 119 FPDF_DOCUMENT document_; |
114 FPDF_FORMHANDLE form_handle_; | 120 FPDF_FORMHANDLE form_handle_; |
115 FPDF_AVAIL avail_; | 121 FPDF_AVAIL avail_; |
116 FX_DOWNLOADHINTS hints_; | 122 FX_DOWNLOADHINTS hints_; |
117 FPDF_FILEACCESS file_access_; | 123 FPDF_FILEACCESS file_access_; |
(...skipping 18 matching lines...) Expand all Loading... |
136 static int SetTimerTrampoline(FPDF_FORMFILLINFO* info, | 142 static int SetTimerTrampoline(FPDF_FORMFILLINFO* info, |
137 int msecs, | 143 int msecs, |
138 TimerCallback fn); | 144 TimerCallback fn); |
139 static void KillTimerTrampoline(FPDF_FORMFILLINFO* info, int id); | 145 static void KillTimerTrampoline(FPDF_FORMFILLINFO* info, int id); |
140 static FPDF_PAGE GetPageTrampoline(FPDF_FORMFILLINFO* info, | 146 static FPDF_PAGE GetPageTrampoline(FPDF_FORMFILLINFO* info, |
141 FPDF_DOCUMENT document, | 147 FPDF_DOCUMENT document, |
142 int page_index); | 148 int page_index); |
143 }; | 149 }; |
144 | 150 |
145 #endif // TESTING_EMBEDDER_TEST_H_ | 151 #endif // TESTING_EMBEDDER_TEST_H_ |
OLD | NEW |