summaryrefslogtreecommitdiffstats
path: root/tests
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
commitc99b95d8cb9f95cd0cec8ad736f139b6029d13c9 (patch)
treea8e0294c5b2825eb70e2c7c66d840dff4fff2f6f /tests
parentbf2fdcbb2920bd73726d905648848ee58e451095 (diff)
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')
-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;