commit | 806850fbb0797e5a1c9da45a517ce9d57b2b3a3e | [log] [tgz] |
---|---|---|
author | Tom Sepez <tsepez@chromium.org> | Wed Sep 08 20:47:22 2021 +0000 |
committer | Pdfium LUCI CQ <pdfium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed Sep 08 20:47:22 2021 +0000 |
tree | 6b04668196d5360243e7d3cee18892896e3c8247 | |
parent | bcb232f997cb3f5a5b15c03b391bfab99f06663e [diff] |
Cover another branch in CPDFSDK_BAAnnot::SetAnnotName() Exercise the path where setting the name to an empty string deletes from the dictionary. Change-Id: If7e24fb6f05fa342bee4fcaa18ec620336509d9c Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/84930 Auto-Submit: Tom Sepez <tsepez@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/testing/resources/javascript/annot_properties.in b/testing/resources/javascript/annot_properties.in index 939365c..e143ac8 100644 --- a/testing/resources/javascript/annot_properties.in +++ b/testing/resources/javascript/annot_properties.in
@@ -74,6 +74,15 @@ } catch (e) { app.alert("ERROR: " + e); } +app.alert("Test setting empty name under changed name"); +try { + var annot = this.getAnnot(0, "nonesuch"); + annot.name = ""; + app.alert("name after empty name change: " + annot.name); +} catch (e) { + app.alert("ERROR: " + e); +} + endstream endobj {{object 22 0}} <<
diff --git a/testing/resources/javascript/annot_properties_expected.txt b/testing/resources/javascript/annot_properties_expected.txt index 54548e6..252fd2b 100644 --- a/testing/resources/javascript/annot_properties_expected.txt +++ b/testing/resources/javascript/annot_properties_expected.txt
@@ -14,3 +14,5 @@ Alert: SUCCESS: Document.getAnnot: Object no longer exists. Alert: Test lookup under changed name Alert: nonesuch after name change: object +Alert: Test setting empty name under changed name +Alert: name after empty name change: