Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Unified Diff: testing/resources/javascript/bug_361.in

Issue 1588733003: test cast for bug_361 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Add more tests and expected results file. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | testing/resources/javascript/bug_361_expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/resources/javascript/bug_361.in
diff --git a/testing/resources/javascript/bug_361.in b/testing/resources/javascript/bug_361.in
new file mode 100644
index 0000000000000000000000000000000000000000..34fde70fe26dc5fe3feea1f82ab54349c9ed0d49
--- /dev/null
+++ b/testing/resources/javascript/bug_361.in
@@ -0,0 +1,91 @@
+{{header}}
+{{object 1 0}} <<
+ /Type /Catalog
+ /Pages 2 0 R
+ /AcroForm 4 0 R
+ /OpenAction 10 0 R
+>>
+endobj
+{{object 2 0}} <<
+ /Type /Pages
+ /Count 1
+ /Kids [
+ 3 0 R
+ ]
+>>
+endobj
+% Page number 0.
+{{object 3 0}} <<
+ /Type /Page
+ /Parent 2 0 R
+ /Resources <<
+ /Font <</F1 15 0 R>>
+ >>
+ /Contents [21 0 R]
+ /MediaBox [0 0 612 792]
+>>
+% Forms
+{{object 4 0}} <<
+ /Fields [5 0 R]
+>>
+% Field
+{{object 5 0}} <<
+ /FT /Tx
+ /T (MyField)
+>>
+% OpenAction action
+{{object 10 0}} <<
+ /Type /Action
+ /S /JavaScript
+ /JS 11 0 R
+>>
+endobj
+% JS program to exexute
+{{object 11 0}} <<
+>>
+stream
+function testField(x) {
+ var field = this.getField("MyField");
+ field.value = x;
+ var y = field.value;
+ app.alert("Answer for \"" + x + "\" is: " + typeof(y) + " " + y);
+}
+testField("goats");
+testField("b4");
+testField("b4.5");
+testField("4x");
+testField("4.5x");
+testField("4");
+testField(" 4");
+testField("4 ");
+testField(" 4 ");
+testField("4 3 2 1");
+testField("-4");
+testField("23.00000001");
+testField("23.00000000000000001");
+testField("25,5");
+testField("1e+5");
+testField("1e5");
+testField("1e-5");
+testField("-1e-5");
+testField("1.2e5");
+testField("NAN");
+testField("INF");
+testField("0x100");
+testField("123x6");
+testField("123xy6");
+testField("123.y6");
+testField("1,000,000");
+testField("1.2.3");
+testField("1-3");
+testField("1+3");
+testField("1.-3");
+testField("1.+3");
+endstream
+endobj
+{{xref}}
+trailer <<
+ /Root 1 0 R
+>>
+{{startxref}}
+%%EOF
« no previous file with comments | « no previous file | testing/resources/javascript/bug_361_expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698