summaryrefslogtreecommitdiff
path: root/testing/resources/javascript
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-01-29 09:10:41 -0800
committerTom Sepez <tsepez@chromium.org>2016-01-29 09:10:41 -0800
commitbd9325754999c2c3a01562ea090654f1ab07cc59 (patch)
treea07252668e75a4dbf1cc820f8175ecc0a867f974 /testing/resources/javascript
parent61dc96f9aa2512807b62cfaec35b1cd012459a6f (diff)
downloadpdfium-bd9325754999c2c3a01562ea090654f1ab07cc59.tar.xz
Merge to XFA: Fix behaviour of app.alert() with a single object argument.
Original Review URL: https://codereview.chromium.org/1641693003 . (cherry picked from commit 66519af52b61ca158044651d0507d47efb364f87) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1639253008 .
Diffstat (limited to 'testing/resources/javascript')
-rw-r--r--testing/resources/javascript/app_alert.in26
-rw-r--r--testing/resources/javascript/app_alert_expected.txt14
2 files changed, 40 insertions, 0 deletions
diff --git a/testing/resources/javascript/app_alert.in b/testing/resources/javascript/app_alert.in
index de6c8a8229..75aecc9075 100644
--- a/testing/resources/javascript/app_alert.in
+++ b/testing/resources/javascript/app_alert.in
@@ -35,6 +35,32 @@ endobj
>>
stream
app.alert("This test passes if alert() logs output under the test utility.");
+app.alert("message", 1, 2, "title");
+app.alert({"cMsg": "message", "cTitle": "title"});
+app.alert({"cMsg": "message", "cTitle": "title", "nIcon": 3, "nType": 4});
+app.alert(undefined);
+app.alert(null);
+app.alert(true);
+app.alert(false);
+app.alert(42);
+app.alert([1, 2, 3]);
+app.alert([1, 2, {"color": "red"}]);
+app.alert({"color": "red"}, 5, 6, "title");
+try {
+ app.alert();
+} catch (e) {
+ app.alert("Caught expected error " + e);
+}
+try {
+ app.alert({});
+} catch (e) {
+ app.alert("Caught expected error " + e);
+}
+try {
+ app.alert({"color": "red", "size": 42});
+} catch (e) {
+ app.alert("Caught expected error " + e);
+}
endstream
endobj
{{xref}}
diff --git a/testing/resources/javascript/app_alert_expected.txt b/testing/resources/javascript/app_alert_expected.txt
index 91205bc91d..b44fa73a94 100644
--- a/testing/resources/javascript/app_alert_expected.txt
+++ b/testing/resources/javascript/app_alert_expected.txt
@@ -1 +1,15 @@
Alert: This test passes if alert() logs output under the test utility.
+title[icon=1,type=2]: message
+title: message
+title[icon=3,type=4]: message
+Alert: undefined
+Alert: null
+Alert: true
+Alert: false
+Alert: 42
+Alert: [1, 2, 3]
+Alert: [1, 2, [object Object]]
+title[icon=5,type=6]: [object Object]
+Alert: Caught expected error app.alert: Incorrect number of parameters passed to function.
+Alert: Caught expected error app.alert: Incorrect number of parameters passed to function.
+Alert: Caught expected error app.alert: Incorrect number of parameters passed to function.