From 72f07c778ea00370f454bda53e2c1178d4a96ff9 Mon Sep 17 00:00:00 2001 From: Wouter Cloetens Date: Tue, 26 Feb 2008 05:36:17 +0000 Subject: 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 * 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. --- tests/check/elements/souphttpsrc.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests/check') 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; -- cgit v1.2.1