Add a pixel test for /Range in PostScript functions.

Illustrate PDFium ignoring the /Range and using the default [0, 1]
range. See bug for details.

BUG=pdfium:1331

Change-Id: I8ddb279bf9b3169e6a91086933b70861281bef77
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/56413
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/testing/SUPPRESSIONS b/testing/SUPPRESSIONS
index fe49416..2edbaa8 100644
--- a/testing/SUPPRESSIONS
+++ b/testing/SUPPRESSIONS
@@ -328,6 +328,9 @@
 # TODO(pdfium:632): Remove after associated bug is fixed
 bug_632.in * * *
 
+# TODO(pdfium:1331): Remove after associated bug is fixed
+bug_1331.in * * *
+
 # xfa_specific
 
 # TODO(pdfium:1107): Remove after associated bug is fixed
diff --git a/testing/resources/pixel/bug_1331.in b/testing/resources/pixel/bug_1331.in
new file mode 100644
index 0000000..53c8b36
--- /dev/null
+++ b/testing/resources/pixel/bug_1331.in
@@ -0,0 +1,81 @@
+{{header}}
+{{object 1 0}} <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+endobj
+{{object 2 0}} <<
+  /Type /Pages
+  /Count 1
+  /Kids [3 0 R]
+>>
+endobj
+{{object 3 0}} <<
+  /Type /Page
+  /Parent 2 0 R
+  /MediaBox [0 0 200 300]
+  /Resources <<
+    /Shading << /Sh0 5 0 R >>
+  >>
+  /Contents 4 0 R
+>>
+endobj
+{{object 4 0}} <<
+  {{streamlen}}
+>>
+stream
+q
+72 0 0 72 10 10 cm
+/Sh0 sh
+Q
+endstream
+endobj
+{{object 5 0}} <<
+  /ShadingType 1
+  /ColorSpace /DeviceRGB
+  /Background [0 .5 .1]
+  /BBox [0 0 72 72]
+  /Domain [-1 1 -1 1]
+  /Function [6 0 R 7 0 R 8 0 R]
+>>
+endobj
+{{object 6 0}} <<
+  /FunctionType 4
+  /Domain [-1 1 -1 1]
+  /Range [-1 1]
+  {{streamlen}}
+>>
+stream
+{
+1
+}
+endstream
+endobj
+{{object 7 0}} <<
+  /FunctionType 4
+  /Domain [-1 1 -1 1]
+  /Range [-1 1]
+  {{streamlen}}
+>>
+stream
+{
+0
+}
+endstream
+endobj
+{{object 8 0}} <<
+  /FunctionType 4
+  /Domain [-1 1 -1 1]
+  /Range [0 1]
+  {{streamlen}}
+>>
+stream
+{
+0
+}
+endstream
+endobj
+{{xref}}
+{{trailer}}
+{{startxref}}
+%%EOF
diff --git a/testing/resources/pixel/bug_1331_expected.pdf.0.png b/testing/resources/pixel/bug_1331_expected.pdf.0.png
new file mode 100644
index 0000000..71649ff
--- /dev/null
+++ b/testing/resources/pixel/bug_1331_expected.pdf.0.png
Binary files differ