From 7203104c34853f1b4d61027ea0f96c8b4b85f2bf Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 18 Oct 2018 21:58:01 +0000 Subject: Try assigning more kinds of values to doc props Change-Id: I99b28f5f047f9043bd95f76f17970d1979276d63 Reviewed-on: https://pdfium-review.googlesource.com/c/44310 Commit-Queue: Tom Sepez Reviewed-by: Lei Zhang --- testing/resources/javascript/document_props.in | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'testing/resources/javascript/document_props.in') diff --git a/testing/resources/javascript/document_props.in b/testing/resources/javascript/document_props.in index efc8e4406f..fa7d92a165 100644 --- a/testing/resources/javascript/document_props.in +++ b/testing/resources/javascript/document_props.in @@ -119,11 +119,11 @@ function testGetProps(props) { } } -function testSetProps(props) { - app.alert('*** Setting properties ***'); +function testSetProps(props, value) { + app.alert('*** Setting properties to ' + value + ' ***'); for (var i = 0; i < props.length; ++i) { try { - var expr1 = "this." + props[i] + ' = 3;' + var expr1 = "this." + props[i] + ' = ' + value + ';' app.alert(expr1 + " yields " + eval(expr1)); } catch (e) { app.alert("ERROR: " + e.toString()); @@ -132,7 +132,12 @@ function testSetProps(props) { } testGetProps(document_props); -testSetProps(document_props); +testSetProps(document_props, 'true'); +testSetProps(document_props, 'false'); +testSetProps(document_props, '["red", 0, "blue", 42]'); +testSetProps(document_props, '{"red": 0, "blue": 42}'); +testSetProps(document_props, '"red"'); +testSetProps(document_props, '3'); testGetProps(document_props); endstream endobj -- cgit v1.2.3