summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-01-29 08:55:30 -0800
committerTom Sepez <tsepez@chromium.org>2016-01-29 08:55:30 -0800
commit66519af52b61ca158044651d0507d47efb364f87 (patch)
treec0def01f0a7603ff7ae0dadd4bed6d3316f508f6 /samples
parentd45e7a51904164fb22049f0a7a80d2a94c06936b (diff)
downloadpdfium-66519af52b61ca158044651d0507d47efb364f87.tar.xz
Fix behaviour of app.alert() with a single object argument.
Centralize the "arguments in an object" logic. See the section "Method Arguments" in the js_api_reference.pdf. Add some tests to hit the ambiguous cases this section implies, and test that all parameters are passed end-to-end to our callbacks. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1641693003 .
Diffstat (limited to 'samples')
-rw-r--r--samples/pdfium_test.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc
index 164364fbaf..3ad0e62626 100644
--- a/samples/pdfium_test.cc
+++ b/samples/pdfium_test.cc
@@ -195,10 +195,15 @@ void WriteEmf(FPDF_PAGE page, const char* pdf_name, int num) {
}
#endif
-int ExampleAppAlert(IPDF_JSPLATFORM*, FPDF_WIDESTRING msg, FPDF_WIDESTRING,
- int, int) {
- std::wstring platform_string = GetPlatformWString(msg);
- printf("Alert: %ls\n", platform_string.c_str());
+int ExampleAppAlert(IPDF_JSPLATFORM*,
+ FPDF_WIDESTRING msg,
+ FPDF_WIDESTRING title,
+ int nType,
+ int nIcon) {
+ printf("%ls", GetPlatformWString(title).c_str());
+ if (nIcon || nType)
+ printf("[icon=%d,type=%d]", nIcon, nType);
+ printf(": %ls\n", GetPlatformWString(msg).c_str());
return 0;
}