diff options
author | Sergio Villar Senin <svillar@igalia.com> | 2013-01-30 17:56:38 +0100 |
---|---|---|
committer | Sergio Villar Senin <svillar@igalia.com> | 2013-02-12 10:15:51 +0100 |
commit | b980d54cb2b77b6b9c54168e9c7ff772734caaac (patch) | |
tree | 6d9cfddad4eb2b68c14b2543a177acf3159ce109 /tests/test-utils.h | |
parent | 52b4df4b2b6d2c70fa333ce712041fd85a65d7c9 (diff) | |
download | libsoup-b980d54cb2b77b6b9c54168e9c7ff772734caaac.tar.gz libsoup-b980d54cb2b77b6b9c54168e9c7ff772734caaac.tar.bz2 libsoup-b980d54cb2b77b6b9c54168e9c7ff772734caaac.zip |
test-utils: add cancellation support to soup_test_request_send
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
Diffstat (limited to 'tests/test-utils.h')
-rw-r--r-- | tests/test-utils.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/test-utils.h b/tests/test-utils.h index ca1003f4..22a4a163 100644 --- a/tests/test-utils.h +++ b/tests/test-utils.h @@ -23,6 +23,13 @@ void apache_init (void); void apache_cleanup (void); #endif +typedef enum { + SOUP_TEST_REQUEST_NONE = 0, + SOUP_TEST_REQUEST_CANCEL_MESSAGE = (1 << 0), + SOUP_TEST_REQUEST_CANCEL_CANCELLABLE = (1 << 1), + SOUP_TEST_REQUEST_CANCEL_SOON = (1 << 2) +} SoupTestRequestFlags; + SoupSession *soup_test_session_new (GType type, ...); void soup_test_session_abort_unref (SoupSession *session); @@ -30,8 +37,9 @@ SoupServer *soup_test_server_new (gboolean in_own_thread); SoupServer *soup_test_server_new_ssl (gboolean in_own_thread); void soup_test_server_quit_unref (SoupServer *server); -GInputStream *soup_test_request_send (SoupRequest *req, - GCancellable *cancellable, +GInputStream *soup_test_request_send (SoupRequest *req, + GCancellable *cancellable, + guint flags, GError **error); gboolean soup_test_request_close_stream (SoupRequest *req, GInputStream *stream, |