summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2021-01-29Imported Upstream version 2.72.0upstream/2.72.0upstreamSeonah Moon11-58/+227
Change-Id: I026585438031f2cf6255822fdd432796c398efe3
2020-02-28Imported Upstream version 2.69.90upstream/2.69.90upstream/2.69.0Seonah Moon31-2266/+3013
Change-Id: I484cce89dab3187f91ab6e005e265514a03028bd
2019-12-09Imported Upstream version 2.62.2upstream/2.62.2Seonah Moon46-1211/+6111
Change-Id: Id151dafaa6ac9f569d76f08282b5c9e4c3b19621
2014-11-04Imported Upstream version 2.46.0upstream/2.46.0Zhang zhengguang53-5148/+7503
2013-04-19Fix build on Windows, deprecate soup-portability.hDan Winship2-4/+4
soup-portability.h created portability problems (ha!) because the windows headers do "#define interface struct", conflicting with variable names elsewhere. The only thing that needed soup-portability.h in the public headers was soup-address.h, which uses struct sockaddr. But we can just do a forward declaration of that type rather than actually pulling in the headers. Then soup-address.h can stop including soup-portability.h, and we can use gio/gnetworking.h in the handful of other places that need networking-related includes. This may possibly break some other modules that depended on implicitly getting network includes as a side effect of including soup.h... https://bugzilla.gnome.org/show_bug.cgi?id=692134
2013-04-18misc-test: skip the IPv6 server test if there's no IPv6 supportDan Winship1-0/+5
https://bugzilla.gnome.org/show_bug.cgi?id=698220
2013-04-17tests: fix to pass when glib-networking TLS isn't availableDan Winship3-20/+43
2013-04-17soup-message-queue: add a priority system to the message queueSergio Villar Senin1-0/+57
Clients can specify a priority for each message added to the SoupSession, which will determine the order in which it is processed by the session's message processing queue. https://bugzilla.gnome.org/show_bug.cgi?id=696277
2013-04-10tests: fix ntlm-test when built without ntlm_auth supportDan Winship1-1/+3
Don't try to use external NTLM auth if built without support for that. https://bugzilla.gnome.org/show_bug.cgi?id=697510
2013-03-20requester-test: fix a printf format compiler warningKalev Lember1-1/+2
Could use G_GSIZE_FORMAT here, but casting to gulong is simpler.
2013-03-11data: URL requests should serve the whole decoded URLZan Dobersek1-0/+86
Address the possibility of data: URLs containing null characters when the data request is being performed. The uri_decoded_copy method is enhanced with a third argument, a pointer to an integer that should be set to the length of decoded data when provided. This length is then set as the request's content length. A test checking the correct behavior is added in requester-test. Calls to uri_decoded_copy where the length of the decoded output is not required are adjusted to provide NULL as the third argument.
2013-03-06SoupAuthManager: deal with "disappearing" auth headersDan Winship1-1/+77
Normally when sending a 401 response, a server re-sends the initial WWW-Authenticate challenge. However, it doesn't actually have to, and libsoup was getting confused if it didn't. Fix that. https://bugzilla.redhat.com/show_bug.cgi?id=916224
2013-03-06SoupSession: break infinite loopsDan Winship1-0/+51
Every year or two some bug comes up that makes libsoup retry a request infinitely. (Also, apps can do this on their own by not paying attention to the "retrying" flag in SoupSession::authenticate.) Move the "too many redirects" code and rework it to handle all possible cases of "message gets resent a suspicious number of times".
2013-03-05soup-cache: update cached headers on revalidationsSergio Villar Senin1-31/+130
SoupCache was not updating the cached headers on conditional requests. We were only doing it for revalidations started by libsoup clients. This also properly reset the values of freshness_lifetime and must_revalidate on revalidations. These two fields were keeping their original values even if the server wasn't providing such information. Finally this adds a new cache test (do_header_test) and fixes the one disabled with #ifdefs (second revalidations). https://bugzilla.gnome.org/show_bug.cgi?id=695121
2013-02-23examples: move examples from tests/ to examples/Dan Winship5-727/+1
get, simple-httpd, and simple-proxy are more example code than test programs, so move them into a separate directory. Also, remove "dns", which was once a sort-of test of SoupAddress, but is now just a redundant sort-of test of GResolver.
2013-02-23build: remove some cruftDan Winship1-3/+0
Remove accumulated cruft, mostly from things we used to depend on but don't any more. Also a few minor drive-by configure cleanups
2013-02-19tests: do skipped tests properlyDan Winship9-34/+128
automake interprets exit code 77 as meaning "skipped", so have the various apache-dependent, php-dependent, and curl-dependent tests do that, and compile them unconditionally. (Although, to avoid "unused" warnings, we end up #ifdeffing out the whole file.)
2013-02-19tests: [CENSORED] [CENSORED] automake [CENSORED]Dan Winship2-8/+24
Specifying serial-tests in AM_INIT_AUTOMAKE breaks the build with automake 1.11, so the only way to support both 1.11 and 1.13 is to make the tests work under the parallel harness. Fortunately this wasn't that hard.
2013-02-18cache-test: added a new cancellation testSergio Villar Senin3-1/+73
Added do_refcounting_test that checks that streams do not leak any reference when a message is cancelled just before starting to read. This test also need a new cancel flag called SOUP_TEST_REQUEST_CANCEL_AFTER_SEND_FINISH. https://bugzilla.gnome.org/show_bug.cgi?id=682527
2013-02-18test-utils: Added SOUP_TEST_REQUEST_CANCEL_IMMEDIATE flagSergio Villar Senin4-7/+14
We were assuming that if the SOUP_TEST_REQUEST_CANCEL_SOON flag was not present then we wanted an immediate cancelation. That worked but now we need to add it to support more cancellation types. https://bugzilla.gnome.org/show_bug.cgi?id=682527
2013-02-16tests: simplify and improve "make check"Dan Winship1-89/+31
Remove rules that automake can figure out itself. Run the tests in alphabetical order. Run "make kill-httpd" at the end of "make check", in case the last httpd-using test crashed.
2013-02-12cache-test: added cancellation testsSergio Villar Senin1-0/+125
Added cancellation tests for both fresh and under revalidation resources. These tests ensure that cancellations happen flawlessly and that any potential revalidation process is also cancelled. https://bugzilla.gnome.org/show_bug.cgi?id=692310
2013-02-12test-utils: add cancellation support to soup_test_request_sendSergio Villar Senin10-46/+120
The function gets a new parametter used to enable request cancellation for both sync and async sessions. The cancellation could be performed by either using the GCancellable or by directly cancelling the SoupMessage. Also the GMainContext used to simulate sync operations with async ones will now try to execute all its pending events before quiting the main loop. https://bugzilla.gnome.org/show_bug.cgi?id=692310
2013-02-07SoupAuthNTLM: fix to do a "retrying" authenticateDan Winship1-0/+88
If the first attempt at NTLM auth fails, let the auth manager emit a "retrying" authenticate as well, just like normal auths do. https://bugzilla.gnome.org/show_bug.cgi?id=693222
2013-01-21Revert "SoupURI: replace NULL password with "" on http"Dan Winship1-6/+6
This broke CalDAV in evolution. I'm not sure exactly why, but if it broke that, it might break other things too, so let's just revert this. This reverts commit 38901ca5e684a8fac75e6ff740d45c82dd44181a. https://bugzilla.gnome.org/show_bug.cgi?id=692149
2013-01-12SoupURI: replace NULL password with "" on httpDan Winship1-6/+6
All supported HTTP auth methods use both username and password, so assume a password of "" if none is given
2013-01-07soup_message_get_https_status: provide info for failed attempts tooDan Winship1-0/+4
SoupMessage:tls-certificate and SoupMessage:tls-errors were only getting set for successful https connections. It is useful to have them be set on failed ones as well. Fix that, and make ssl-test test it. https://bugzilla.gnome.org/show_bug.cgi?id=690176
2013-01-02soup-auth-manager: add soup_auth_manager_use_auth()Dan Winship1-4/+12
Add soup_auth_manager_use_auth(), for "preloading" authentication, and make the old automatically-request-NTLM behavior happen only for the legacy SoupSession subclasses.
2013-01-02ntlm-test: kill some dead codeDan Winship1-5/+0
2013-01-02ntlm-test-helper: fixDan Winship2-2/+2
We need to set SOUP_NTLM_AUTH_DEBUG to an empty string (to tell SoupAuthNTLM to always use built-in NTLM), not leave it unset, which will let SoupAuthNTLM use the real ntlm_auth binary. (The effect of this bug was that instead of always using built-in NTLM, ntlm-test-helper would first try to use ntlm_auth, and fail because there were no cached credentials, and then fall back to built-in NTLM, which meant that we were testing the fallback codepath even in the supposed-to-be-non-fallback case. Unless your username was "alice" or "bob" and you had a working winbind configuration, in which case the tests would just fail.) Also, fix up ntlm-test a bit, so that if ntlm-test-helper for some reason tries to authenticate as someone other than alice or bob, it recognizes this, rather than considering everyone who isn't alice to be bob.
2012-12-29Reorganize NTLM authentication, fix ntlm_auth supportDan Winship3-8/+157
Move the auth-managery parts of SoupAuthManagerNTLM down into SoupAuthManager, and the NTLMy parts into SoupAuthNTLM (in preparation for supporting other kinds of connection-based auth such as Negotiate). The reorganization also makes it possible to use SoupAuthNTLM to implement a mock version of /usr/bin/ntlm_auth, so we can extend ntlm-test to test both the built-in-NTLM and external-NTLM codepaths. Doing this reveals that, AFAICT, the external codepath did not previously actually work, because it mis-used G_SPAWN_FILE_AND_ARGV_ZERO and so ended up passing incorrect arguments to /usr/bin/ntlm_auth.
2012-12-28tests: add session-testDan Winship2-0/+237
Add a test that each of the 3 SoupSession types (plain, async, sync) behaves as expected with soup_session_queue_message(), soup_session_send_message(), and soup_session_cancel_message().
2012-12-28Revert the mirroring of SoupMessage API onto SoupRequestHTTP.Dan Winship6-31/+59
SoupMessage isn't being deprecated, and mirroring its API onto SoupRequestHTTP is just going to result in always having to add every new API twice. Also, it turns out to be less useful than originally expected anyway, since you end up having to cast between SoupRequest and SoupRequestHTTP frequently anyway. This reverts commit d7117329400e47d2187ed033099d921d555f8d71 and most of commit 53c270d0e2868fa5ad48ce864f10a9486b11a071.
2012-12-28Add back LIBSOUP_DISABLE_DEPRECATEDDan Winship1-1/+0
gtk-doc expects "Deprecated:" notes in docs to be matched up with some deprecation-guard #define. So even though we don't want people to use it any more, add LIBSOUP_DISABLE_DEPRECATED back.
2012-12-26tests: add cache-testDan Winship2-0/+444
Add a test of basic cache functionality (finally!) Still needs more tests...
2012-12-26test-utils: remove unnecessary #includesDan Winship1-3/+0
2012-12-17soup-message: deprecate soup_message_set_chunk_allocator()Dan Winship1-0/+2
This was added as a hacky way to avoid extra memcpy()s in certain use cases by reading data directly into a caller-provided buffer. However, SoupRequest now provides a vastly simpler way of doing this.
2012-12-11tests: fix memory leaksDan Winship4-5/+37
2012-12-10soup-uri: don't decode %00 in URIsDan Winship1-0/+3
We were accidentally decoding %00 to '\0' in URIs, causing a few WebKit tests to fail. Leave it undecoded instead.
2012-12-10tests: fix SoupRequester deprecation warningsDan Winship3-28/+20
Fix multipart-test and resource-test to use the new SoupSession APIs rather than SoupRequester. Fix requester-test (which intentionally tests that SoupRequester still works too) to not show deprecation warnings.
2012-12-10SoupSession: add soup_session_request_http() and _request_http_uri()Dan Winship2-77/+55
Add SoupSession helpers to return SoupRequestHTTP directly and allow overriding the request method.
2012-12-10SoupRequest: add soup_request_disable_feature()Dan Winship1-51/+75
Add soup_request_disable_feature(), which proxies to soup_message_disable_feature() for SoupRequestHTTP and is a no-op otherwise. Add SoupRequest tests to sniffing-test, which also tests soup_request_disable_feature() now.
2012-12-10SoupRequestHTTP: mirror SoupMessage fields/APIDan Winship3-27/+21
Mirror various SoupMessage-related API onto SoupRequestHTTP so that you don't need to resort to soup_request_http_get_message().
2012-12-10Move SoupRequester API into SoupSession, declare SoupRequest stableDan Winship7-96/+71
Add soup_session_request() and soup_session_request_uri(), implementing basically the same behavior as soup_requester_request() and soup_requester_request_uri() (but without requiring a separate SoupSessionFeature), and remove the unstable-api ifdefs from soup-request*.h. SoupRequester still exists, but it is still guarded by the unstable-api ifdefs, and is just a dummy wrapper around the functionality that is now in SoupSession.
2012-12-10SoupSession: allow creating a "plain" SoupSession for use with new APIsDan Winship1-19/+44
In gio-based APIs, async vs sync is a function-level distinction, not a class-level distinction. Merge most of the existing SoupSessionAsync and SoupSessionSync code up into SoupSession, and make SoupSession non-abstract, so that you can create a SoupSession and then use either sync or async SoupRequest-based APIs on it. (The traditional APIs still require one of the traditional subclasses, although the code reorg does affect them in some ways, such as making SoupSessionAsync more thread-safe.)
2012-12-09tests/uri-parsing: check empty username/passwordDan Winship1-0/+5
Make sure that zero-length username/password are recognized as different from no username/password.
2012-12-04Better handle the failure of URI embedded credentialsMartin Robinson1-1/+4
When using credentials embedded in the URI, clear them so that a failure will trigger the authentication signal and the use of previously remembered credentials.
2012-12-04tests: fix a few bugsDan Winship2-6/+8
Fix a few places where the test might crash rather than reporting an error when something went wrong.
2012-12-04tests/simple-httpd: use GMappedFile rather than mmapDan Winship1-45/+12
(fixing a fd leak in the process)
2012-11-17SoupLogger: fix printing of Host header with IPv6 literalDan Winship1-1/+29
SoupLogger was misprinting Host headers with IPv6 literals (even though soup-message-client-io was sending them correctly). Fix that. Also includes an addition to misc-test to verify that the Host header received by the server is correct (which it already was, but the SoupLogger bug made me think it wasn't.)