summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberto Garcia <berto@igalia.com>2013-11-25 01:22:19 +0200
committerDan Winship <danw@gnome.org>2014-02-17 12:22:19 -0500
commita3f393f69363ea663bee9ff9ad8c950b8bbdc8c9 (patch)
tree1735cd96976d02070d8e23c583434c8ffb8804e5
parentfa2b82c870277a4b6717c852ea0185442af93014 (diff)
downloadlibsoup-a3f393f69363ea663bee9ff9ad8c950b8bbdc8c9.tar.gz
sniffing: test that it allows leading whitespace in doctype headers
https://bugzilla.gnome.org/show_bug.cgi?id=715126
-rw-r--r--tests/resources/leading_space.html12
-rw-r--r--tests/sniffing-test.c3
-rw-r--r--tests/soup-tests.gresource.xml1
3 files changed, 16 insertions, 0 deletions
diff --git a/tests/resources/leading_space.html b/tests/resources/leading_space.html
new file mode 100644
index 00000000..a640d653
--- /dev/null
+++ b/tests/resources/leading_space.html
@@ -0,0 +1,12 @@
+
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title></title>
+</head>
+<body>
+<h1>GNOME!</h1>
+</body>
+</html>
diff --git a/tests/sniffing-test.c b/tests/sniffing-test.c
index a8bc3ffc..2dc9fb2c 100644
--- a/tests/sniffing-test.c
+++ b/tests/sniffing-test.c
@@ -524,6 +524,9 @@ main (int argc, char **argv)
g_test_add_data_func ("/sniffing/type/unknown-binary",
"unknown/text_binary.txt => application/octet-stream",
do_sniffing_test);
+ g_test_add_data_func ("/sniffing/type/unknown-leading-space",
+ "unknown/leading_space.html => text/html",
+ do_sniffing_test);
/* Test the XML sniffing path */
g_test_add_data_func ("/sniffing/type/xml",
diff --git a/tests/soup-tests.gresource.xml b/tests/soup-tests.gresource.xml
index 2fe21ddc..d24a04b0 100644
--- a/tests/soup-tests.gresource.xml
+++ b/tests/soup-tests.gresource.xml
@@ -5,6 +5,7 @@
<file>resources/atom.xml</file>
<file>resources/home.gif</file>
<file>resources/html_binary.html</file>
+ <file>resources/leading_space.html</file>
<file>resources/mbox</file>
<file>resources/mbox.gz</file>
<file>resources/mbox.raw</file>