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

Side by Side Diff: testing/embedder_test.cpp

Issue 1652533002: Add tests for CBA_AnnotIterator. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 10 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
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 #include "testing/embedder_test.h" 5 #include "testing/embedder_test.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 8
9 #include <list> 9 #include <list>
10 #include <string> 10 #include <string>
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 FPDF_DestroyLibrary(); 85 FPDF_DestroyLibrary();
86 86
87 #ifdef PDF_ENABLE_V8 87 #ifdef PDF_ENABLE_V8
88 v8::V8::ShutdownPlatform(); 88 v8::V8::ShutdownPlatform();
89 delete platform_; 89 delete platform_;
90 #endif // PDF_ENABLE_V8 90 #endif // PDF_ENABLE_V8
91 91
92 delete loader_; 92 delete loader_;
93 } 93 }
94 94
95 CPDFSDK_Document* EmbedderTest::GetSDKDocument() const {
96 CPDFDoc_Environment* pEnv =
97 reinterpret_cast<CPDFDoc_Environment*>(form_handle_);
Lei Zhang 2016/01/29 23:39:23 Can we just expose FormHandleToSDKDoc() and use th
Tom Sepez 2016/01/29 23:55:48 Done.
98 return pEnv ? pEnv->GetSDKDocument() : nullptr;
99 }
100
95 bool EmbedderTest::CreateEmptyDocument() { 101 bool EmbedderTest::CreateEmptyDocument() {
96 document_ = FPDF_CreateNewDocument(); 102 document_ = FPDF_CreateNewDocument();
97 if (!document_) 103 if (!document_)
98 return false; 104 return false;
99 105
100 SetupFormFillEnvironment(); 106 SetupFormFillEnvironment();
101 return true; 107 return true;
102 } 108 }
103 109
104 bool EmbedderTest::OpenDocument(const std::string& filename, 110 bool EmbedderTest::OpenDocument(const std::string& filename,
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 } 301 }
296 302
297 // Can't use gtest-provided main since we need to stash the path to the 303 // Can't use gtest-provided main since we need to stash the path to the
298 // executable in order to find the external V8 binary data files. 304 // executable in order to find the external V8 binary data files.
299 int main(int argc, char** argv) { 305 int main(int argc, char** argv) {
300 g_exe_path_ = argv[0]; 306 g_exe_path_ = argv[0];
301 testing::InitGoogleTest(&argc, argv); 307 testing::InitGoogleTest(&argc, argv);
302 testing::InitGoogleMock(&argc, argv); 308 testing::InitGoogleMock(&argc, argv);
303 return RUN_ALL_TESTS(); 309 return RUN_ALL_TESTS();
304 } 310 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698