summaryrefslogtreecommitdiffstats
path: root/image/test/reftest/generic
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:44:51 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:44:51 +0000
commit9e3c08db40b8916968b9f30096c7be3f00ce9647 (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /image/test/reftest/generic
parentInitial commit. (diff)
downloadthunderbird-9e3c08db40b8916968b9f30096c7be3f00ce9647.tar.xz
thunderbird-9e3c08db40b8916968b9f30096c7be3f00ce9647.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'image/test/reftest/generic')
-rw-r--r--image/test/reftest/generic/accept-image-catchall-ref.html12
-rw-r--r--image/test/reftest/generic/accept-image-catchall.html13
-rw-r--r--image/test/reftest/generic/check-header.sjs72
-rw-r--r--image/test/reftest/generic/green.pngbin0 -> 201 bytes
-rw-r--r--image/test/reftest/generic/moz-icon-1.html1
-rw-r--r--image/test/reftest/generic/moz-icon-blank-1-almostref.html2
-rw-r--r--image/test/reftest/generic/moz-icon-blank-1-antiref.html2
-rw-r--r--image/test/reftest/generic/moz-icon-blank-1-antiref2.html2
-rw-r--r--image/test/reftest/generic/moz-icon-blank-1-ref.html2
-rw-r--r--image/test/reftest/generic/moz-icon-blank-1.html2
-rw-r--r--image/test/reftest/generic/reftest.list6
11 files changed, 114 insertions, 0 deletions
diff --git a/image/test/reftest/generic/accept-image-catchall-ref.html b/image/test/reftest/generic/accept-image-catchall-ref.html
new file mode 100644
index 0000000000..32daa9f5d6
--- /dev/null
+++ b/image/test/reftest/generic/accept-image-catchall-ref.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=398066
+-->
+<html>
+<head>
+ <title>Accept: header should include image/* catchall</title>
+</head>
+<body>
+<img src="green.png">
+</body>
+</html>
diff --git a/image/test/reftest/generic/accept-image-catchall.html b/image/test/reftest/generic/accept-image-catchall.html
new file mode 100644
index 0000000000..bcacd9fd8f
--- /dev/null
+++ b/image/test/reftest/generic/accept-image-catchall.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=398066.
+https://bugzilla.mozilla.org/show_bug.cgi?id=1249474.
+-->
+<html>
+<head>
+ <title>Accept: header should include */* catchall</title>
+</head>
+<body>
+<img src="check-header.sjs">
+</body>
+</html>
diff --git a/image/test/reftest/generic/check-header.sjs b/image/test/reftest/generic/check-header.sjs
new file mode 100644
index 0000000000..afc39cb550
--- /dev/null
+++ b/image/test/reftest/generic/check-header.sjs
@@ -0,0 +1,72 @@
+const BinaryOutputStream = Components.Constructor("@mozilla.org/binaryoutputstream;1", "nsIBinaryOutputStream", "setOutputStream");
+
+function isCatchall(v)
+{
+ // "*/*" exactly
+ return /^\*\/\*$/.test(v);
+}
+
+/*
+# Python used to generate the following byte array
+def toHex(n):
+ if n < 16: return "0x" + hex(n)[2:].upper()
+ return "0x" + hex(n)[2:].upper()
+
+def hexFile(name):
+ f = open(name, "rb")
+ try:
+ while True:
+ print toHex(ord(f.read(1))) + ", ",
+ except:
+ pass
+
+hexFile("image/test/reftest/generic/green.png")
+*/
+
+const IMAGE_DATA =
+ [
+ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00,
+ 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00,
+ 0x00, 0x64, 0x08, 0x02, 0x00, 0x00, 0x00, 0xFF, 0x80, 0x02, 0x03,
+ 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xAE, 0xCE,
+ 0x1C, 0xE9, 0x00, 0x00, 0x00, 0x9E, 0x49, 0x44, 0x41, 0x54, 0x78,
+ 0xDA, 0xED, 0xD0, 0x31, 0x01, 0x00, 0x00, 0x08, 0x03, 0xA0, 0x69,
+ 0xFF, 0xCE, 0x5A, 0xC1, 0xCF, 0x07, 0x22, 0x50, 0x99, 0x70, 0xD4,
+ 0x0A, 0x64, 0xC9, 0x92, 0x25, 0x4B, 0x96, 0x2C, 0x05, 0xB2, 0x64,
+ 0xC9, 0x92, 0x25, 0x4B, 0x96, 0x02, 0x59, 0xB2, 0x64, 0xC9, 0x92,
+ 0x25, 0x4B, 0x81, 0x2C, 0x59, 0xB2, 0x64, 0xC9, 0x92, 0xA5, 0x40,
+ 0x96, 0x2C, 0x59, 0xB2, 0x64, 0xC9, 0x52, 0x20, 0x4B, 0x96, 0x2C,
+ 0x59, 0xB2, 0x64, 0x29, 0x90, 0x25, 0x4B, 0x96, 0x2C, 0x59, 0xB2,
+ 0x14, 0xC8, 0x92, 0x25, 0x4B, 0x96, 0x2C, 0x59, 0x0A, 0x64, 0xC9,
+ 0x92, 0x25, 0x4B, 0x96, 0x2C, 0x05, 0xB2, 0x64, 0xC9, 0x92, 0x25,
+ 0x4B, 0x96, 0x02, 0x59, 0xB2, 0x64, 0xC9, 0x92, 0x25, 0x4B, 0x81,
+ 0x2C, 0x59, 0xB2, 0x64, 0xC9, 0x92, 0xA5, 0x40, 0x96, 0x2C, 0x59,
+ 0xB2, 0x64, 0xC9, 0x52, 0x20, 0x4B, 0x96, 0x2C, 0x59, 0xB2, 0x64,
+ 0x29, 0x90, 0x25, 0x4B, 0x96, 0x2C, 0x59, 0xB2, 0x14, 0xC8, 0x92,
+ 0x25, 0x4B, 0x96, 0x2C, 0x59, 0x0A, 0x64, 0xC9, 0xFA, 0xB6, 0x89,
+ 0x5F, 0x01, 0xC7, 0x24, 0x83, 0xB2, 0x0C, 0x00, 0x00, 0x00, 0x00,
+ 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82,
+ ];
+
+function handleRequest(request, response)
+{
+ response.setHeader("Content-Type", "text/plain", false);
+ response.setHeader("Cache-Control", "no-cache", false);
+
+ var accept = request.hasHeader("Accept")
+ ? request.getHeader("Accept")
+ : "";
+
+ if (accept.split(",").some(isCatchall))
+ {
+ response.setHeader("Content-Type", "image/png", false);
+
+ var stream = new BinaryOutputStream(response.bodyOutputStream);
+ stream.writeByteArray(IMAGE_DATA);
+ }
+ else
+ {
+ response.setStatusLine(request.httpVersion, 404, "Not found");
+ response.write("Accept header contained: " + accept);
+ }
+}
diff --git a/image/test/reftest/generic/green.png b/image/test/reftest/generic/green.png
new file mode 100644
index 0000000000..4718c00e62
--- /dev/null
+++ b/image/test/reftest/generic/green.png
Binary files differ
diff --git a/image/test/reftest/generic/moz-icon-1.html b/image/test/reftest/generic/moz-icon-1.html
new file mode 100644
index 0000000000..fb2dcea202
--- /dev/null
+++ b/image/test/reftest/generic/moz-icon-1.html
@@ -0,0 +1 @@
+<img class="downscale" src="moz-icon://bogus-unrecognized-icon?size=100">
diff --git a/image/test/reftest/generic/moz-icon-blank-1-almostref.html b/image/test/reftest/generic/moz-icon-blank-1-almostref.html
new file mode 100644
index 0000000000..38d5e1ec86
--- /dev/null
+++ b/image/test/reftest/generic/moz-icon-blank-1-almostref.html
@@ -0,0 +1,2 @@
+<!-- this should draw an icon similar to a blank document but with writing on it -->
+<img src="moz-icon://.txt?size=16">
diff --git a/image/test/reftest/generic/moz-icon-blank-1-antiref.html b/image/test/reftest/generic/moz-icon-blank-1-antiref.html
new file mode 100644
index 0000000000..2631ff4018
--- /dev/null
+++ b/image/test/reftest/generic/moz-icon-blank-1-antiref.html
@@ -0,0 +1,2 @@
+<!-- this draws the icon for current directory on the c: drive on windows -->
+<img src="moz-icon:file:///C:/?size=16">
diff --git a/image/test/reftest/generic/moz-icon-blank-1-antiref2.html b/image/test/reftest/generic/moz-icon-blank-1-antiref2.html
new file mode 100644
index 0000000000..8553c81be0
--- /dev/null
+++ b/image/test/reftest/generic/moz-icon-blank-1-antiref2.html
@@ -0,0 +1,2 @@
+<!-- this draws the icon for the c: drive on windows -->
+<img src="moz-icon:file:///C://?size=16">
diff --git a/image/test/reftest/generic/moz-icon-blank-1-ref.html b/image/test/reftest/generic/moz-icon-blank-1-ref.html
new file mode 100644
index 0000000000..086d5af837
--- /dev/null
+++ b/image/test/reftest/generic/moz-icon-blank-1-ref.html
@@ -0,0 +1,2 @@
+<!-- this should draw a blank document icon -->
+<img src="moz-icon://bogus-unrecognized-icon.bogusunknown845?size=16">
diff --git a/image/test/reftest/generic/moz-icon-blank-1.html b/image/test/reftest/generic/moz-icon-blank-1.html
new file mode 100644
index 0000000000..2b52c96297
--- /dev/null
+++ b/image/test/reftest/generic/moz-icon-blank-1.html
@@ -0,0 +1,2 @@
+<!-- this should draw a blank document icon -->
+<img src="moz-icon://test?size=16&contentType=application/octet-stream">
diff --git a/image/test/reftest/generic/reftest.list b/image/test/reftest/generic/reftest.list
new file mode 100644
index 0000000000..6f236399ef
--- /dev/null
+++ b/image/test/reftest/generic/reftest.list
@@ -0,0 +1,6 @@
+HTTP == accept-image-catchall.html accept-image-catchall-ref.html
+skip-if(Android) != moz-icon-1.html about:blank
+== moz-icon-blank-1.html moz-icon-blank-1-ref.html
+skip-if(Android) != moz-icon-blank-1-ref.html moz-icon-blank-1-antiref.html
+skip-if(Android) != moz-icon-blank-1-ref.html moz-icon-blank-1-antiref2.html
+fuzzy-if(OSX,44-49,335-348) fuzzy-if(winWidget,64-140,45-191) == moz-icon-blank-1-almostref.html moz-icon-blank-1-ref.html