diff options
author | Sergio Villar Senin <svillar@igalia.com> | 2013-02-15 21:40:37 +0100 |
---|---|---|
committer | Sergio Villar Senin <svillar@igalia.com> | 2013-02-18 11:03:15 +0100 |
commit | 054b1e3059f5b9b677d2117ecc3130fa6cd79f1a (patch) | |
tree | d42c1013bb092c6d99107d06973dc082ce40236f /tests/test-utils.c | |
parent | 3f294a7b6661df7d8dfad3dff175f8807b257c44 (diff) | |
download | libsoup-054b1e3059f5b9b677d2117ecc3130fa6cd79f1a.tar.gz |
cache-test: added a new cancellation test
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
Diffstat (limited to 'tests/test-utils.c')
-rw-r--r-- | tests/test-utils.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test-utils.c b/tests/test-utils.c index 754b84a9..a2c24cfc 100644 --- a/tests/test-utils.c +++ b/tests/test-utils.c @@ -469,6 +469,16 @@ soup_test_request_send (SoupRequest *req, stream = soup_request_send_finish (req, data.result, error); + if (cancel_data && (flags & SOUP_TEST_REQUEST_CANCEL_AFTER_SEND_FINISH)) { + GMainContext *context; + + cancel_message_or_cancellable (cancel_data); + + context = g_main_loop_get_context (data.loop); + while (g_main_context_pending (context)) + g_main_context_iteration (context, FALSE); + } + g_main_loop_unref (data.loop); g_object_unref (data.result); |