diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-02-13 12:08:44 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-02-13 12:08:44 -0800 |
commit | 58985096a7852263df68e87d9bfc335a3e2759bf (patch) | |
tree | ec32924d809dcb02f0c233b4fe21b5b2e2c469b3 /samples | |
parent | 254360730190cc6d6e3de325ee101948b78c1e32 (diff) | |
download | pdfium-chromium/2307.tar.xz |
Test top-level Document JS properties.chromium/2313chromium/2312chromium/2310chromium/2309chromium/2308chromium/2307chromium/2306chromium/2305
Along the way, I rename some functions in pdfium_test.cc to
match the style guide's FunctionName() syntax, adding
"Example" to make them obviously different from the PDF
internal code with similar name fragments.
The purpose is to at least have some coverage for the
setter/getter macros from JS_Define.h
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/928573002
Diffstat (limited to 'samples')
-rw-r--r-- | samples/pdfium_test.cc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc index 20658fbf4d..8f9c832fb2 100644 --- a/samples/pdfium_test.cc +++ b/samples/pdfium_test.cc @@ -216,8 +216,8 @@ void WriteEmf(FPDF_PAGE page, const char* pdf_name, int num) { } #endif -int Form_Alert(IPDF_JSPLATFORM*, FPDF_WIDESTRING msg, FPDF_WIDESTRING, - int, int) { +int ExampleAppAlert(IPDF_JSPLATFORM*, FPDF_WIDESTRING msg, FPDF_WIDESTRING, + int, int) { // Deal with differences between UTF16LE and wchar_t on this platform. size_t characters = 0; while (msg[characters]) { @@ -234,7 +234,11 @@ int Form_Alert(IPDF_JSPLATFORM*, FPDF_WIDESTRING msg, FPDF_WIDESTRING, return 0; } -void Unsupported_Handler(UNSUPPORT_INFO*, int type) { +void ExampleDocGotoPage(IPDF_JSPLATFORM*, int pageNumber) { + printf("Goto Page: %d\n", pageNumber); +} + +void ExampleUnsupportedHandler(UNSUPPORT_INFO*, int type) { std::string feature = "Unknown"; switch (type) { case FPDF_UNSP_DOC_XFAFORM: @@ -373,7 +377,8 @@ void RenderPdf(const std::string& name, const char* pBuf, size_t len, IPDF_JSPLATFORM platform_callbacks; memset(&platform_callbacks, '\0', sizeof(platform_callbacks)); platform_callbacks.version = 1; - platform_callbacks.app_alert = Form_Alert; + platform_callbacks.app_alert = ExampleAppAlert; + platform_callbacks.Doc_gotoPage = ExampleDocGotoPage; FPDF_FORMFILLINFO form_callbacks; memset(&form_callbacks, '\0', sizeof(form_callbacks)); @@ -534,7 +539,7 @@ int main(int argc, const char* argv[]) { UNSUPPORT_INFO unsuppored_info; memset(&unsuppored_info, '\0', sizeof(unsuppored_info)); unsuppored_info.version = 1; - unsuppored_info.FSDK_UnSupport_Handler = Unsupported_Handler; + unsuppored_info.FSDK_UnSupport_Handler = ExampleUnsupportedHandler; FSDK_SetUnSpObjProcessHandler(&unsuppored_info); |