summaryrefslogtreecommitdiffstats
path: root/tests/check/elements
diff options
context:
space:
mode:
authorWouter Cloetens <wouter@mind.be>2008-02-26 05:36:17 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2008-02-26 05:36:17 +0000
commit72f07c778ea00370f454bda53e2c1178d4a96ff9 (patch)
treec8f852ccbb485ca2032900021058e25b1e8878e1 /tests/check/elements
parent188190e0e88869d6c5e1097518715f90b5b74169 (diff)
downloadgst-plugins-bad-72f07c778ea00370f454bda53e2c1178d4a96ff9.tar.gz
gst-plugins-bad-72f07c778ea00370f454bda53e2c1178d4a96ff9.tar.bz2
gst-plugins-bad-72f07c778ea00370f454bda53e2c1178d4a96ff9.zip
Add support for specifying a list of cookies to be passed in the HTTP request. Fixes bug #518722.
Original commit message from CVS: Patch by: Wouter Cloetens <wouter at mind dot be> * ext/soup/gstsouphttpsrc.c: (gst_soup_http_src_class_init), (gst_soup_http_src_init), (gst_soup_http_src_dispose), (gst_soup_http_src_set_property), (gst_soup_http_src_get_property), (gst_soup_http_src_create): * ext/soup/gstsouphttpsrc.h: * tests/check/elements/souphttpsrc.c: (run_test), (GST_START_TEST), (souphttpsrc_suite): Add support for specifying a list of cookies to be passed in the HTTP request. Fixes bug #518722.
Diffstat (limited to 'tests/check/elements')
-rw-r--r--tests/check/elements/souphttpsrc.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/check/elements/souphttpsrc.c b/tests/check/elements/souphttpsrc.c
index 6f5cac00..0fc9c6a6 100644
--- a/tests/check/elements/souphttpsrc.c
+++ b/tests/check/elements/souphttpsrc.c
@@ -32,6 +32,7 @@
static int http_port = 0, https_port = 0;
gboolean redirect = TRUE;
+static const char **cookies = NULL;
static int run_server (int *http_port, int *https_port);
@@ -80,6 +81,8 @@ run_test (const char *format, ...)
g_free (url);
g_object_set (src, "automatic-redirect", redirect, NULL);
+ if (cookies != NULL)
+ g_object_set (src, "cookies", cookies, NULL);
g_object_set (sink, "signal-handoffs", TRUE, NULL);
g_signal_connect (sink, "preroll-handoff", G_CALLBACK (handoff_cb), &buf);
@@ -185,6 +188,19 @@ GST_START_TEST (test_https)
GST_END_TEST;
+GST_START_TEST (test_cookies)
+{
+ static const char *biscotti[] = { "delacre=yummie", "koekje=lu", NULL };
+ int rc;
+
+ cookies = biscotti;
+ rc = run_test ("http://127.0.0.1:%d/", http_port);
+ cookies = NULL;
+ fail_unless (rc == 0);
+}
+
+GST_END_TEST;
+
GST_START_TEST (test_icy_stream)
{
GstElement *pipe, *src, *sink;
@@ -276,6 +292,7 @@ souphttpsrc_suite (void)
tcase_add_test (tc_chain, test_redirect_no);
tcase_add_test (tc_chain, test_not_found);
tcase_add_test (tc_chain, test_forbidden);
+ tcase_add_test (tc_chain, test_cookies);
tcase_add_test (tc_chain, test_icy_stream);
return s;