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

Side by Side Diff: testing/embedder_test.h

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 #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 "fpdfsdk/include/fsdk_mgr.h"
12 #include "public/fpdf_dataavail.h" 13 #include "public/fpdf_dataavail.h"
13 #include "public/fpdf_ext.h" 14 #include "public/fpdf_ext.h"
14 #include "public/fpdf_formfill.h" 15 #include "public/fpdf_formfill.h"
15 #include "public/fpdfview.h" 16 #include "public/fpdfview.h"
16 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
17 #include "testing/test_support.h" 18 #include "testing/test_support.h"
18 19
19 #ifdef PDF_ENABLE_V8 20 #ifdef PDF_ENABLE_V8
20 #include "v8/include/v8.h" 21 #include "v8/include/v8.h"
21 #endif // PDF_ENABLE_v8 22 #endif // PDF_ENABLE_v8
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 // Call before SetUp to pass shared isolate, otherwise PDFium creates one. 70 // Call before SetUp to pass shared isolate, otherwise PDFium creates one.
70 void SetExternalIsolate(void* isolate) { 71 void SetExternalIsolate(void* isolate) {
71 external_isolate_ = static_cast<v8::Isolate*>(isolate); 72 external_isolate_ = static_cast<v8::Isolate*>(isolate);
72 } 73 }
73 #endif // PDF_ENABLE_V8 74 #endif // PDF_ENABLE_V8
74 75
75 void SetDelegate(Delegate* delegate) { 76 void SetDelegate(Delegate* delegate) {
76 delegate_ = delegate ? delegate : default_delegate_.get(); 77 delegate_ = delegate ? delegate : default_delegate_.get();
77 } 78 }
78 79
79 FPDF_DOCUMENT document() { return document_; } 80 FPDF_DOCUMENT document() const { return document_; }
80 FPDF_FORMHANDLE form_handle() { return form_handle_; } 81 FPDF_FORMHANDLE form_handle() const { return form_handle_; }
82 CPDFSDK_Document* GetSDKDocument() const;
81 83
82 // Create an empty document, and its form fill environment. Returns true 84 // Create an empty document, and its form fill environment. Returns true
83 // on success or false on failure. 85 // on success or false on failure.
84 virtual bool CreateEmptyDocument(); 86 virtual bool CreateEmptyDocument();
85 87
86 // Open the document specified by |filename|, and create its form fill 88 // Open the document specified by |filename|, and create its form fill
87 // environment, or return false on failure. 89 // environment, or return false on failure.
88 // The filename is relative to the test data directory where we store all the 90 // The filename is relative to the test data directory where we store all the
89 // test files. 91 // test files.
90 virtual bool OpenDocument(const std::string& filename, 92 virtual bool OpenDocument(const std::string& filename,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 static int SetTimerTrampoline(FPDF_FORMFILLINFO* info, 144 static int SetTimerTrampoline(FPDF_FORMFILLINFO* info,
143 int msecs, 145 int msecs,
144 TimerCallback fn); 146 TimerCallback fn);
145 static void KillTimerTrampoline(FPDF_FORMFILLINFO* info, int id); 147 static void KillTimerTrampoline(FPDF_FORMFILLINFO* info, int id);
146 static FPDF_PAGE GetPageTrampoline(FPDF_FORMFILLINFO* info, 148 static FPDF_PAGE GetPageTrampoline(FPDF_FORMFILLINFO* info,
147 FPDF_DOCUMENT document, 149 FPDF_DOCUMENT document,
148 int page_index); 150 int page_index);
149 }; 151 };
150 152
151 #endif // TESTING_EMBEDDER_TEST_H_ 153 #endif // TESTING_EMBEDDER_TEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698