summaryrefslogtreecommitdiff
path: root/tests/cookies-test.c
diff options
context:
space:
mode:
authorClaudio Saavedra <csaavedra@igalia.com>2018-03-05 19:24:11 +0200
committerClaudio Saavedra <csaavedra@igalia.com>2018-03-05 19:24:11 +0200
commit15abc70541531f916e4cf19010ffef5fc656005e (patch)
treebb4e82ce62edf05a4fba3e9d44a3f5b388c1e93e /tests/cookies-test.c
parentd04a7f9adf0f2e3a51d22be6ab10822613aed09b (diff)
downloadlibsoup-15abc70541531f916e4cf19010ffef5fc656005e.tar.gz
Revert "cookie-jar: use base domain to decide if cookie is third party"
This reverts commit 20a8463ae65369ac17f8bca7749be188a275a99f.
Diffstat (limited to 'tests/cookies-test.c')
-rw-r--r--tests/cookies-test.c48
1 files changed, 0 insertions, 48 deletions
diff --git a/tests/cookies-test.c b/tests/cookies-test.c
index e0293974..479bcfe7 100644
--- a/tests/cookies-test.c
+++ b/tests/cookies-test.c
@@ -94,53 +94,6 @@ do_cookies_accept_policy_test (void)
soup_test_session_abort_unref (session);
}
-static void
-do_cookies_subdomain_policy_test (void)
-{
- SoupCookieJar *jar;
- GSList *cookies;
- SoupURI *uri1;
- SoupURI *uri2;
-
- g_test_bug ("792130");
-
- /* Only the base domain should be considered when deciding
- * whether a cookie is a third-party cookie.
- */
- uri1 = soup_uri_new ("https://www.gnome.org");
- uri2 = soup_uri_new ("https://foundation.gnome.org");
-
- /* We can't check subdomains with a test server running on
- * localhost, so we'll just check the cookie jar API itself.
- */
-
- /* Cookie should be accepted. One cookie in the jar. */
- jar = soup_cookie_jar_new ();
- soup_cookie_jar_set_accept_policy (jar, SOUP_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY);
- soup_cookie_jar_set_cookie_with_first_party (jar, uri1, uri2, "1=foo");
- cookies = soup_cookie_jar_all_cookies (jar);
- g_assert_cmpint (g_slist_length (cookies), ==, 1);
- g_slist_free_full (cookies, (GDestroyNotify)soup_cookie_free);
-
- /* Cookie should be accepted. Two cookies in the jar. */
- soup_cookie_jar_set_cookie_with_first_party (jar, uri2, uri1, "2=foo");
- cookies = soup_cookie_jar_all_cookies (jar);
- g_assert_cmpint (g_slist_length (cookies), ==, 2);
- g_slist_free_full (cookies, (GDestroyNotify)soup_cookie_free);
-
- /* Third-party cookie should be rejected, so there are still
- * only two cookies in the jar.
- */
- soup_cookie_jar_set_cookie_with_first_party (jar, third_party_uri, uri1, "3=foo");
- cookies = soup_cookie_jar_all_cookies (jar);
- g_assert_cmpint (g_slist_length (cookies), ==, 2);
- g_slist_free_full (cookies, (GDestroyNotify)soup_cookie_free);
-
- soup_uri_free (uri1);
- soup_uri_free (uri2);
- g_object_unref (jar);
-}
-
/* FIXME: moar tests! */
static void
do_cookies_parsing_test (void)
@@ -229,7 +182,6 @@ main (int argc, char **argv)
soup_uri_set_port (third_party_uri, server_uri->port);
g_test_add_func ("/cookies/accept-policy", do_cookies_accept_policy_test);
- g_test_add_func ("/cookies/accept-policy-subdomains", do_cookies_subdomain_policy_test);
g_test_add_func ("/cookies/parsing", do_cookies_parsing_test);
ret = g_test_run ();