summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGustavo Noronha Silva <gns@gnome.org>2013-12-10 17:17:40 +0100
committerDan Winship <danw@gnome.org>2014-02-17 12:22:22 -0500
commit26a65181db0b1fc3eb97748a5e3d9ceeecdc62e3 (patch)
treebe860eeb83a20700f6290ea3866264871aaed61f /tests
parentcd4f6a94f9275670091326a5aec8a07bce7f8d79 (diff)
downloadlibsoup-26a65181db0b1fc3eb97748a5e3d9ceeecdc62e3.tar.gz
sniffing: Bring image sniffing up-to-date with the MIMESNIFF spec
Diffstat (limited to 'tests')
-rw-r--r--tests/resources/home.jpgbin0 -> 1074 bytes
-rw-r--r--tests/resources/home.pngbin0 -> 313 bytes
-rw-r--r--tests/resources/tux.webpbin0 -> 17128 bytes
-rw-r--r--tests/sniffing-test.c11
-rw-r--r--tests/soup-tests.gresource.xml3
5 files changed, 13 insertions, 1 deletions
diff --git a/tests/resources/home.jpg b/tests/resources/home.jpg
new file mode 100644
index 00000000..ac1f3bbc
--- /dev/null
+++ b/tests/resources/home.jpg
Binary files differ
diff --git a/tests/resources/home.png b/tests/resources/home.png
new file mode 100644
index 00000000..0bb82bac
--- /dev/null
+++ b/tests/resources/home.png
Binary files differ
diff --git a/tests/resources/tux.webp b/tests/resources/tux.webp
new file mode 100644
index 00000000..8764f066
--- /dev/null
+++ b/tests/resources/tux.webp
Binary files differ
diff --git a/tests/sniffing-test.c b/tests/sniffing-test.c
index 498df976..868b7c5f 100644
--- a/tests/sniffing-test.c
+++ b/tests/sniffing-test.c
@@ -554,9 +554,18 @@ main (int argc, char **argv)
do_sniffing_test);
/* Test the image sniffing path */
- g_test_add_data_func ("/sniffing/type/image",
+ g_test_add_data_func ("/sniffing/type/image/gif",
"type/image_png/home.gif => image/gif",
do_sniffing_test);
+ g_test_add_data_func ("/sniffing/type/image/png",
+ "type/image_gif/home.png => image/png",
+ do_sniffing_test);
+ g_test_add_data_func ("/sniffing/type/image/jpeg",
+ "type/image_png/home.jpg => image/jpeg",
+ do_sniffing_test);
+ g_test_add_data_func ("/sniffing/type/image/webp",
+ "type/image_png/tux.webp => image/webp",
+ do_sniffing_test);
/* The spec tells us to only use the last Content-Type header */
g_test_add_data_func ("/sniffing/multiple-headers",
diff --git a/tests/soup-tests.gresource.xml b/tests/soup-tests.gresource.xml
index 320cd63d..444ed588 100644
--- a/tests/soup-tests.gresource.xml
+++ b/tests/soup-tests.gresource.xml
@@ -5,6 +5,8 @@
<file>resources/atom.xml</file>
<file>resources/feed.rdf</file>
<file>resources/home.gif</file>
+ <file>resources/home.jpg</file>
+ <file>resources/home.png</file>
<file>resources/html_binary.html</file>
<file>resources/leading_space.html</file>
<file>resources/mbox</file>
@@ -16,5 +18,6 @@
<file>resources/test.html</file>
<file>resources/text.txt</file>
<file>resources/text_binary.txt</file>
+ <file>resources/tux.webp</file>
</gresource>
</gresources>