Test removing last instanceManager instance.
Must be subject to the <occurs> contraints.
Change-Id: Ia4fd4c26e0690f1155a9449058913fc0b43d4c61
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/66031
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/testing/resources/javascript/xfa_specific/instance_manager.in b/testing/resources/javascript/xfa_specific/instance_manager.in
index a47827f..fe3d776 100644
--- a/testing/resources/javascript/xfa_specific/instance_manager.in
+++ b/testing/resources/javascript/xfa_specific/instance_manager.in
@@ -77,9 +77,13 @@
expectError("mgr.removeInstance()");
expectError("mgr.removeInstance(1, 2)");
expect("mgr.removeInstance(0)", undefined);
- expect("mgr.count", 4);
expect("mgr.removeInstance(0)", undefined);
- expect("mgr.count", 3);
+ expect("mgr.removeInstance(0)", undefined);
+ expect("mgr.removeInstance(0)", undefined);
+ expect("mgr.count", 1);
+
+ expectError("mgr.removeInstance(0)");
+ expect("mgr.count", 1);
]]></script>
</event>
</subform>
diff --git a/testing/resources/javascript/xfa_specific/instance_manager_expected.txt b/testing/resources/javascript/xfa_specific/instance_manager_expected.txt
index 60137e2..9956b88 100644
--- a/testing/resources/javascript/xfa_specific/instance_manager_expected.txt
+++ b/testing/resources/javascript/xfa_specific/instance_manager_expected.txt
@@ -31,6 +31,9 @@
Alert: PASS: mgr.removeInstance() threw XFAObject.removeInstance: Incorrect number of parameters passed to function.
Alert: PASS: mgr.removeInstance(1, 2) threw XFAObject.removeInstance: Incorrect number of parameters passed to function.
Alert: PASS: mgr.removeInstance(0) = undefined
-Alert: PASS: mgr.count = 4
Alert: PASS: mgr.removeInstance(0) = undefined
-Alert: PASS: mgr.count = 3
+Alert: PASS: mgr.removeInstance(0) = undefined
+Alert: PASS: mgr.removeInstance(0) = undefined
+Alert: PASS: mgr.count = 1
+Alert: PASS: mgr.removeInstance(0) threw XFAObject.removeInstance: Too many occurances.
+Alert: PASS: mgr.count = 1