Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(449)

Side by Side Diff: testing/embedder_test.h

Issue 1563513002: Return unique_ptrs from test_support functions (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: namespace pdfium Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « samples/pdfium_test.cc ('k') | testing/embedder_test.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
11 11
12 #include "public/fpdf_dataavail.h" 12 #include "public/fpdf_dataavail.h"
13 #include "public/fpdf_ext.h" 13 #include "public/fpdf_ext.h"
14 #include "public/fpdf_formfill.h" 14 #include "public/fpdf_formfill.h"
15 #include "public/fpdfview.h" 15 #include "public/fpdfview.h"
16 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
17 #include "testing/test_support.h"
17 18
18 #ifdef PDF_ENABLE_V8 19 #ifdef PDF_ENABLE_V8
19 #include "v8/include/v8.h" 20 #include "v8/include/v8.h"
20 #endif // PDF_ENABLE_v8 21 #endif // PDF_ENABLE_v8
21 22
22 class TestLoader; 23 class TestLoader;
23 24
24 // This class is used to load a PDF document, and then run programatic 25 // This class is used to load a PDF document, and then run programatic
25 // API tests against it. 26 // API tests against it.
26 class EmbedderTest : public ::testing::Test, 27 class EmbedderTest : public ::testing::Test,
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 FPDF_FILEACCESS file_access_; 117 FPDF_FILEACCESS file_access_;
117 FX_FILEAVAIL file_avail_; 118 FX_FILEAVAIL file_avail_;
118 #ifdef PDF_ENABLE_V8 119 #ifdef PDF_ENABLE_V8
119 v8::Platform* platform_; 120 v8::Platform* platform_;
120 v8::StartupData natives_; 121 v8::StartupData natives_;
121 v8::StartupData snapshot_; 122 v8::StartupData snapshot_;
122 #endif // PDF_ENABLE_V8 123 #endif // PDF_ENABLE_V8
123 void* external_isolate_; 124 void* external_isolate_;
124 TestLoader* loader_; 125 TestLoader* loader_;
125 size_t file_length_; 126 size_t file_length_;
126 char* file_contents_; 127 std::unique_ptr<char, pdfium::FreeDeleter> file_contents_;
127 128
128 private: 129 private:
129 static void UnsupportedHandlerTrampoline(UNSUPPORT_INFO*, int type); 130 static void UnsupportedHandlerTrampoline(UNSUPPORT_INFO*, int type);
130 static int AlertTrampoline(IPDF_JSPLATFORM* plaform, 131 static int AlertTrampoline(IPDF_JSPLATFORM* plaform,
131 FPDF_WIDESTRING message, 132 FPDF_WIDESTRING message,
132 FPDF_WIDESTRING title, 133 FPDF_WIDESTRING title,
133 int type, 134 int type,
134 int icon); 135 int icon);
135 static int SetTimerTrampoline(FPDF_FORMFILLINFO* info, 136 static int SetTimerTrampoline(FPDF_FORMFILLINFO* info,
136 int msecs, 137 int msecs,
137 TimerCallback fn); 138 TimerCallback fn);
138 static void KillTimerTrampoline(FPDF_FORMFILLINFO* info, int id); 139 static void KillTimerTrampoline(FPDF_FORMFILLINFO* info, int id);
139 static FPDF_PAGE GetPageTrampoline(FPDF_FORMFILLINFO* info, 140 static FPDF_PAGE GetPageTrampoline(FPDF_FORMFILLINFO* info,
140 FPDF_DOCUMENT document, 141 FPDF_DOCUMENT document,
141 int page_index); 142 int page_index);
142 }; 143 };
143 144
144 #endif // TESTING_EMBEDDER_TEST_H_ 145 #endif // TESTING_EMBEDDER_TEST_H_
OLDNEW
« no previous file with comments | « samples/pdfium_test.cc ('k') | testing/embedder_test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698