| 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 <string> | 10 #include <string> |
| 10 | 11 |
| 11 #include "public/fpdf_dataavail.h" | 12 #include "public/fpdf_dataavail.h" |
| 12 #include "public/fpdf_ext.h" | 13 #include "public/fpdf_ext.h" |
| 13 #include "public/fpdf_formfill.h" | 14 #include "public/fpdf_formfill.h" |
| 14 #include "public/fpdfview.h" | 15 #include "public/fpdfview.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 16 #include "third_party/base/nonstd_unique_ptr.h" | |
| 17 | 17 |
| 18 #ifdef PDF_ENABLE_V8 | 18 #ifdef PDF_ENABLE_V8 |
| 19 #include "v8/include/v8.h" | 19 #include "v8/include/v8.h" |
| 20 #endif // PDF_ENABLE_v8 | 20 #endif // PDF_ENABLE_v8 |
| 21 | 21 |
| 22 class TestLoader; | 22 class TestLoader; |
| 23 | 23 |
| 24 // This class is used to load a PDF document, and then run programatic | 24 // This class is used to load a PDF document, and then run programatic |
| 25 // API tests against it. | 25 // API tests against it. |
| 26 class EmbedderTest : public ::testing::Test, | 26 class EmbedderTest : public ::testing::Test, |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 // Convert a loaded page into a bitmap. | 102 // Convert a loaded page into a bitmap. |
| 103 virtual FPDF_BITMAP RenderPage(FPDF_PAGE page); | 103 virtual FPDF_BITMAP RenderPage(FPDF_PAGE page); |
| 104 | 104 |
| 105 // Relese the resources obtained from LoadPage(). Further use of |page| | 105 // Relese the resources obtained from LoadPage(). Further use of |page| |
| 106 // is prohibited after this call is made. | 106 // is prohibited after this call is made. |
| 107 virtual void UnloadPage(FPDF_PAGE page); | 107 virtual void UnloadPage(FPDF_PAGE page); |
| 108 | 108 |
| 109 protected: | 109 protected: |
| 110 Delegate* delegate_; | 110 Delegate* delegate_; |
| 111 nonstd::unique_ptr<Delegate> default_delegate_; | 111 std::unique_ptr<Delegate> default_delegate_; |
| 112 FPDF_DOCUMENT document_; | 112 FPDF_DOCUMENT document_; |
| 113 FPDF_FORMHANDLE form_handle_; | 113 FPDF_FORMHANDLE form_handle_; |
| 114 FPDF_AVAIL avail_; | 114 FPDF_AVAIL avail_; |
| 115 FX_DOWNLOADHINTS hints_; | 115 FX_DOWNLOADHINTS hints_; |
| 116 FPDF_FILEACCESS file_access_; | 116 FPDF_FILEACCESS file_access_; |
| 117 FX_FILEAVAIL file_avail_; | 117 FX_FILEAVAIL file_avail_; |
| 118 #ifdef PDF_ENABLE_V8 | 118 #ifdef PDF_ENABLE_V8 |
| 119 v8::Platform* platform_; | 119 v8::Platform* platform_; |
| 120 v8::StartupData natives_; | 120 v8::StartupData natives_; |
| 121 v8::StartupData snapshot_; | 121 v8::StartupData snapshot_; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 135 static int SetTimerTrampoline(FPDF_FORMFILLINFO* info, | 135 static int SetTimerTrampoline(FPDF_FORMFILLINFO* info, |
| 136 int msecs, | 136 int msecs, |
| 137 TimerCallback fn); | 137 TimerCallback fn); |
| 138 static void KillTimerTrampoline(FPDF_FORMFILLINFO* info, int id); | 138 static void KillTimerTrampoline(FPDF_FORMFILLINFO* info, int id); |
| 139 static FPDF_PAGE GetPageTrampoline(FPDF_FORMFILLINFO* info, | 139 static FPDF_PAGE GetPageTrampoline(FPDF_FORMFILLINFO* info, |
| 140 FPDF_DOCUMENT document, | 140 FPDF_DOCUMENT document, |
| 141 int page_index); | 141 int page_index); |
| 142 }; | 142 }; |
| 143 | 143 |
| 144 #endif // TESTING_EMBEDDER_TEST_H_ | 144 #endif // TESTING_EMBEDDER_TEST_H_ |
| OLD | NEW |