summaryrefslogtreecommitdiff
path: root/tests/test-new-trickle.c
diff options
context:
space:
mode:
authorJakub Adam <jakub.adam@collabora.com>2019-02-11 17:20:01 +0100
committerOlivier CrĂȘte <olivier.crete@ocrete.ca>2019-03-08 14:41:30 +0000
commitf8e6e5b93a4a73578753afe4955b2e278a1990c4 (patch)
tree9cb58c8bffbb4338c3254766af3b4dd09976946f /tests/test-new-trickle.c
parentcce48cfbf64157c79fecd8d84260a407ea08ecb6 (diff)
downloadlibnice-f8e6e5b93a4a73578753afe4955b2e278a1990c4.tar.gz
tests: enable "trickle-ice" mode
Call nice_agent_peer_candidate_gathering_done () where appropriate.
Diffstat (limited to 'tests/test-new-trickle.c')
-rw-r--r--tests/test-new-trickle.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test-new-trickle.c b/tests/test-new-trickle.c
index a3a4452..0be38b9 100644
--- a/tests/test-new-trickle.c
+++ b/tests/test-new-trickle.c
@@ -493,6 +493,7 @@ static void standard_test(NiceAgent *lagent, NiceAgent *ragent)
g_main_context_iteration (NULL, TRUE);
g_cancellable_reset (global_cancellable);
g_assert (ragent_candidate_gathering_done);
+ g_assert (nice_agent_peer_candidate_gathering_done (lagent, global_ls_id));
g_debug ("Setting local candidates of ragent as remote candidates of lagent");
@@ -514,6 +515,7 @@ static void standard_test(NiceAgent *lagent, NiceAgent *ragent)
g_cancellable_reset (global_cancellable);
g_assert (lagent_candidate_gathering_done);
+ g_assert (nice_agent_peer_candidate_gathering_done (ragent, global_rs_id));
while (global_ragent_state < NICE_COMPONENT_STATE_CONNECTED)
g_main_context_iteration (NULL, TRUE);
@@ -548,6 +550,7 @@ static void bad_credentials_test(NiceAgent *lagent, NiceAgent *ragent)
g_main_context_iteration (NULL, TRUE);
g_cancellable_reset (global_cancellable);
g_assert (ragent_candidate_gathering_done);
+ g_assert (nice_agent_peer_candidate_gathering_done (lagent, global_ls_id));
g_debug ("Setting local candidates of ragent as remote candidates of lagent");
swap_candidates (ragent, global_rs_id, lagent, global_ls_id, FALSE);
@@ -579,6 +582,7 @@ static void bad_credentials_test(NiceAgent *lagent, NiceAgent *ragent)
g_cancellable_reset (global_cancellable);
g_assert (lagent_candidate_gathering_done);
+ g_assert (nice_agent_peer_candidate_gathering_done (ragent, global_rs_id));
cleanup (lagent, ragent);
}
@@ -604,6 +608,7 @@ static void bad_candidate_test(NiceAgent *lagent,NiceAgent *ragent)
g_cancellable_reset (global_cancellable);
g_assert (ragent_candidate_gathering_done);
+ g_assert (nice_agent_peer_candidate_gathering_done (lagent, global_ls_id));
add_bad_candidate (lagent, global_ls_id, cand);
@@ -612,6 +617,8 @@ static void bad_candidate_test(NiceAgent *lagent,NiceAgent *ragent)
g_main_context_iteration (NULL, TRUE);
g_cancellable_reset (global_cancellable);
+ g_assert (nice_agent_peer_candidate_gathering_done (ragent, global_rs_id));
+
// connchecks will fail causing this mainloop to quit
while (global_lagent_state != NICE_COMPONENT_STATE_FAILED)
g_main_context_iteration (NULL, TRUE);
@@ -659,6 +666,7 @@ static void new_candidate_test(NiceAgent *lagent, NiceAgent *ragent)
while (!ragent_candidate_gathering_done)
g_main_context_iteration (NULL, TRUE);
g_cancellable_reset (global_cancellable);
+ g_assert (nice_agent_peer_candidate_gathering_done (lagent, global_ls_id));
// Wait for data
while (!data_received)
@@ -677,6 +685,7 @@ static void new_candidate_test(NiceAgent *lagent, NiceAgent *ragent)
!lagent_candidate_gathering_done)
g_main_context_iteration (NULL, TRUE);
g_cancellable_reset (global_cancellable);
+ g_assert (nice_agent_peer_candidate_gathering_done (ragent, global_rs_id));
g_assert (lagent_candidate_gathering_done);
g_assert (ragent_candidate_gathering_done);
@@ -739,6 +748,9 @@ int main(void)
g_object_set (G_OBJECT (lagent), "ice-tcp", FALSE, NULL);
g_object_set (G_OBJECT (ragent), "ice-tcp", FALSE, NULL);
+ g_object_set (G_OBJECT (lagent), "ice-trickle", TRUE, NULL);
+ g_object_set (G_OBJECT (ragent), "ice-trickle", TRUE, NULL);
+
g_object_set (G_OBJECT (lagent), "controlling-mode", TRUE, NULL);
g_object_set (G_OBJECT (ragent), "controlling-mode", FALSE, NULL);