[libsoup/http2] tests: fix http2 tests
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup/http2] tests: fix http2 tests
- Date: Mon, 10 May 2021 11:39:52 +0000 (UTC)
commit 9ff46e0ada8b0ec6e15214989145378cdbb68d95
Author: Carlos Garcia Campos <cgarcia igalia com>
Date: Mon May 10 13:38:13 2021 +0200
tests: fix http2 tests
tests/http2-test.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
---
diff --git a/tests/http2-test.c b/tests/http2-test.c
index 4f4e69db..5e60a564 100644
--- a/tests/http2-test.c
+++ b/tests/http2-test.c
@@ -162,6 +162,9 @@ do_multi_message_async_test (Test *test, gconstpointer data)
g_assert_cmpstr (g_bytes_get_data (response1, NULL), ==, "body%201");
g_assert_cmpstr (g_bytes_get_data (response2, NULL), ==, "body%202");
+ while (g_main_context_pending (async_context))
+ g_main_context_iteration (async_context, FALSE);
+
g_bytes_unref (response1);
g_bytes_unref (response2);
g_object_unref (msg1);
@@ -209,6 +212,9 @@ do_post_async_test (Test *test, gconstpointer data)
g_assert_cmpstr (g_bytes_get_data (response, NULL), ==, "body 1");
+ while (g_main_context_pending (async_context))
+ g_main_context_iteration (async_context, FALSE);
+
g_bytes_unref (response);
g_bytes_unref (bytes);
g_main_context_unref (async_context);
@@ -244,6 +250,9 @@ do_post_blocked_async_test (Test *test, gconstpointer data)
g_assert_cmpstr (g_bytes_get_data (response, NULL), ==, "Part 1 - Part 2");
+ while (g_main_context_pending (async_context))
+ g_main_context_iteration (async_context, FALSE);
+
g_bytes_unref (response);
g_object_unref (in_stream);
g_main_context_unref (async_context);
@@ -269,6 +278,9 @@ do_post_file_async_test (Test *test, gconstpointer data)
g_assert_true (g_str_has_prefix (g_bytes_get_data (response, NULL), "-----BEGIN CERTIFICATE-----"));
+ while (g_main_context_pending (async_context))
+ g_main_context_iteration (async_context, FALSE);
+
g_bytes_unref (response);
g_object_unref (in_stream);
g_object_unref (in_file);
@@ -368,6 +380,9 @@ do_connections_test (Test *test, gconstpointer data)
soup_session_send_async (test->session, msg, G_PRIORITY_DEFAULT, NULL, on_send_ready,
&complete_count);
g_object_unref (msg);
+ while (g_main_context_pending (async_context))
+ g_main_context_iteration (async_context, FALSE);
+
g_main_context_unref (async_context);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]