Add a JavaScript test for AFDate_FormatEx().

Demonstrate the current AFDate_FormatEx() behavior. When the input does
not match the expected format, e.g. "12302015" for "mm/dd/yyyy",
AFDate_FormatEx() parses the input incorrectly in a nonsensical manner.

Bug: chromium:572901
Change-Id: I6638582df1dd799b66a936627f6287c945173e7e
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/61471
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
diff --git a/testing/resources/javascript/public_methods.in b/testing/resources/javascript/public_methods.in
index 200b8ec..e8d7ab6 100644
--- a/testing/resources/javascript/public_methods.in
+++ b/testing/resources/javascript/public_methods.in
@@ -123,6 +123,10 @@
       expectEventValue("x", "AFDate_FormatEx(2)", "2");
       expectEventValue("x", "AFDate_FormatEx('blooey')", "blooey");
       expectEventValue("x", "AFDate_FormatEx('m/d')", "5/9");
+      // TODO(crbug.com/572901): This is wrong. AFDate_FormatEx() should throw
+      // an error like Adobe Acrobat.
+      expectEventValue("12302015", "AFDate_FormatEx('mm/dd/yyyy')", "12/02/2015");
+      expectEventValue("20122015", "AFDate_FormatEx('mm/dd/yyyy')", "05/09/2014");
 
       app.alert("**********************");
 
diff --git a/testing/resources/javascript/public_methods_expected.txt b/testing/resources/javascript/public_methods_expected.txt
index c0ee226..1c8a315 100644
--- a/testing/resources/javascript/public_methods_expected.txt
+++ b/testing/resources/javascript/public_methods_expected.txt
@@ -11,6 +11,8 @@
 Alert: PASS: AFDate_FormatEx(2) = 2
 Alert: PASS: AFDate_FormatEx('blooey') = blooey
 Alert: PASS: AFDate_FormatEx('m/d') = 5/9
+Alert: PASS: AFDate_FormatEx('mm/dd/yyyy') = 12/02/2015
+Alert: PASS: AFDate_FormatEx('mm/dd/yyyy') = 05/09/2014
 Alert: **********************
 Alert: PASS: AFDate_Keystroke() threw AFDate_Keystroke: Incorrect number of parameters passed to function.
 Alert: PASS: AFDate_Keystroke(1, 2) threw AFDate_Keystroke: Incorrect number of parameters passed to function.