Commit f8e6e5b9 authored by Jakub Adam's avatar Jakub Adam Committed by Olivier Crête

tests: enable "trickle-ice" mode

Call nice_agent_peer_candidate_gathering_done () where appropriate.
parent cce48cfb
...@@ -493,6 +493,7 @@ static void standard_test(NiceAgent *lagent, NiceAgent *ragent) ...@@ -493,6 +493,7 @@ static void standard_test(NiceAgent *lagent, NiceAgent *ragent)
g_main_context_iteration (NULL, TRUE); g_main_context_iteration (NULL, TRUE);
g_cancellable_reset (global_cancellable); g_cancellable_reset (global_cancellable);
g_assert (ragent_candidate_gathering_done); 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"); g_debug ("Setting local candidates of ragent as remote candidates of lagent");
...@@ -514,6 +515,7 @@ static void standard_test(NiceAgent *lagent, NiceAgent *ragent) ...@@ -514,6 +515,7 @@ static void standard_test(NiceAgent *lagent, NiceAgent *ragent)
g_cancellable_reset (global_cancellable); g_cancellable_reset (global_cancellable);
g_assert (lagent_candidate_gathering_done); 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) while (global_ragent_state < NICE_COMPONENT_STATE_CONNECTED)
g_main_context_iteration (NULL, TRUE); g_main_context_iteration (NULL, TRUE);
...@@ -548,6 +550,7 @@ static void bad_credentials_test(NiceAgent *lagent, NiceAgent *ragent) ...@@ -548,6 +550,7 @@ static void bad_credentials_test(NiceAgent *lagent, NiceAgent *ragent)
g_main_context_iteration (NULL, TRUE); g_main_context_iteration (NULL, TRUE);
g_cancellable_reset (global_cancellable); g_cancellable_reset (global_cancellable);
g_assert (ragent_candidate_gathering_done); 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"); g_debug ("Setting local candidates of ragent as remote candidates of lagent");
swap_candidates (ragent, global_rs_id, lagent, global_ls_id, FALSE); swap_candidates (ragent, global_rs_id, lagent, global_ls_id, FALSE);
...@@ -579,6 +582,7 @@ static void bad_credentials_test(NiceAgent *lagent, NiceAgent *ragent) ...@@ -579,6 +582,7 @@ static void bad_credentials_test(NiceAgent *lagent, NiceAgent *ragent)
g_cancellable_reset (global_cancellable); g_cancellable_reset (global_cancellable);
g_assert (lagent_candidate_gathering_done); g_assert (lagent_candidate_gathering_done);
g_assert (nice_agent_peer_candidate_gathering_done (ragent, global_rs_id));
cleanup (lagent, ragent); cleanup (lagent, ragent);
} }
...@@ -604,6 +608,7 @@ static void bad_candidate_test(NiceAgent *lagent,NiceAgent *ragent) ...@@ -604,6 +608,7 @@ static void bad_candidate_test(NiceAgent *lagent,NiceAgent *ragent)
g_cancellable_reset (global_cancellable); g_cancellable_reset (global_cancellable);
g_assert (ragent_candidate_gathering_done); 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); add_bad_candidate (lagent, global_ls_id, cand);
...@@ -612,6 +617,8 @@ static void bad_candidate_test(NiceAgent *lagent,NiceAgent *ragent) ...@@ -612,6 +617,8 @@ static void bad_candidate_test(NiceAgent *lagent,NiceAgent *ragent)
g_main_context_iteration (NULL, TRUE); g_main_context_iteration (NULL, TRUE);
g_cancellable_reset (global_cancellable); 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 // connchecks will fail causing this mainloop to quit
while (global_lagent_state != NICE_COMPONENT_STATE_FAILED) while (global_lagent_state != NICE_COMPONENT_STATE_FAILED)
g_main_context_iteration (NULL, TRUE); g_main_context_iteration (NULL, TRUE);
...@@ -659,6 +666,7 @@ static void new_candidate_test(NiceAgent *lagent, NiceAgent *ragent) ...@@ -659,6 +666,7 @@ static void new_candidate_test(NiceAgent *lagent, NiceAgent *ragent)
while (!ragent_candidate_gathering_done) while (!ragent_candidate_gathering_done)
g_main_context_iteration (NULL, TRUE); g_main_context_iteration (NULL, TRUE);
g_cancellable_reset (global_cancellable); g_cancellable_reset (global_cancellable);
g_assert (nice_agent_peer_candidate_gathering_done (lagent, global_ls_id));
// Wait for data // Wait for data
while (!data_received) while (!data_received)
...@@ -677,6 +685,7 @@ static void new_candidate_test(NiceAgent *lagent, NiceAgent *ragent) ...@@ -677,6 +685,7 @@ static void new_candidate_test(NiceAgent *lagent, NiceAgent *ragent)
!lagent_candidate_gathering_done) !lagent_candidate_gathering_done)
g_main_context_iteration (NULL, TRUE); g_main_context_iteration (NULL, TRUE);
g_cancellable_reset (global_cancellable); 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 (lagent_candidate_gathering_done);
g_assert (ragent_candidate_gathering_done); g_assert (ragent_candidate_gathering_done);
...@@ -739,6 +748,9 @@ int main(void) ...@@ -739,6 +748,9 @@ int main(void)
g_object_set (G_OBJECT (lagent), "ice-tcp", FALSE, NULL); 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 (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 (lagent), "controlling-mode", TRUE, NULL);
g_object_set (G_OBJECT (ragent), "controlling-mode", FALSE, NULL); g_object_set (G_OBJECT (ragent), "controlling-mode", FALSE, NULL);
......
...@@ -272,6 +272,9 @@ int main (void) ...@@ -272,6 +272,9 @@ int main (void)
g_object_set (G_OBJECT (lagent), "controlling-mode", TRUE, NULL); g_object_set (G_OBJECT (lagent), "controlling-mode", TRUE, NULL);
g_object_set (G_OBJECT (ragent), "controlling-mode", FALSE, NULL); g_object_set (G_OBJECT (ragent), "controlling-mode", FALSE, NULL);
g_object_set (G_OBJECT (lagent), "ice-trickle", TRUE, NULL);
g_object_set (G_OBJECT (ragent), "ice-trickle", TRUE, NULL);
/* An application using more than one NiceAgent instance may crash due to /* An application using more than one NiceAgent instance may crash due to
* a race in gUPnP. * a race in gUPnP.
* *
...@@ -336,6 +339,9 @@ int main (void) ...@@ -336,6 +339,9 @@ int main (void)
nice_candidate_free ((NiceCandidate *) i->data); nice_candidate_free ((NiceCandidate *) i->data);
g_slist_free (cands); g_slist_free (cands);
nice_agent_peer_candidate_gathering_done (lagent, ls_id);
nice_agent_peer_candidate_gathering_done (ragent, rs_id);
g_debug ("test-trickle: Set properties, next running mainloop until connectivity checks succeed..."); g_debug ("test-trickle: Set properties, next running mainloop until connectivity checks succeed...");
/* step: run the mainloop until connectivity checks succeed /* step: run the mainloop until connectivity checks succeed
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment