@@ -363,11 +363,11 @@ defmodule ExICE.Priv.ICEAgentTest do
363
363
364
364
assert ice_agent . state == :closed
365
365
assert ice_agent . gathering_state == :complete
366
- assert [ % { state: :failed } ] = Map . values ( ice_agent . checklist )
366
+ assert [ % { state: :failed } = pair ] = Map . values ( ice_agent . checklist )
367
367
assert [ % { base: % { closed?: true } } ] = Map . values ( ice_agent . local_cands )
368
368
# make sure that sockets and remote cands were not cleared
369
369
assert [ _remote_cand ] = Map . values ( ice_agent . remote_cands )
370
- assert ice_agent . sockets != [ ]
370
+ assert [ socket ] = ice_agent . sockets
371
371
372
372
# check stats
373
373
stats = ICEAgent . get_stats ( ice_agent )
@@ -379,8 +379,28 @@ defmodule ExICE.Priv.ICEAgentTest do
379
379
refute_received { :ex_ice , _pid , { :connection_state_change , :closed } }
380
380
refute_received { :ex_ice , _pid , { :gathering_state_change , :complete } }
381
381
382
- # try to restart ICE, this should be ignored
383
- % { state: :closed , gathering_state: :complete } = ICEAgent . restart ( ice_agent )
382
+ # assert these functions are ignored
383
+ assert ice_agent == ICEAgent . set_role ( ice_agent , :controlled )
384
+ assert ice_agent == ICEAgent . set_remote_credentials ( ice_agent , "remoteufrag2" , "remotepwd2" )
385
+ assert ice_agent == ICEAgent . gather_candidates ( ice_agent )
386
+ assert ice_agent == ICEAgent . add_remote_candidate ( ice_agent , @ remote_cand2 )
387
+ assert ice_agent == ICEAgent . end_of_candidates ( ice_agent )
388
+ assert ice_agent == ICEAgent . send_data ( ice_agent , << 0 , 1 , 2 >> )
389
+ assert ice_agent == ICEAgent . restart ( ice_agent )
390
+ assert ice_agent == ICEAgent . handle_ta_timeout ( ice_agent )
391
+ # only eoc_timer should change to nil
392
+ assert % { ice_agent | eoc_timer: nil } == ICEAgent . handle_eoc_timeout ( ice_agent )
393
+ assert ice_agent == ICEAgent . handle_pair_timeout ( ice_agent )
394
+ assert ice_agent == ICEAgent . handle_keepalive_timeout ( ice_agent , pair . id )
395
+
396
+ assert ice_agent ==
397
+ ICEAgent . handle_udp (
398
+ ice_agent ,
399
+ socket ,
400
+ @ remote_cand . address ,
401
+ @ remote_cand . port ,
402
+ "some data"
403
+ )
384
404
end
385
405
386
406
test "doesn't add pairs with srflx local candidate to the checklist" do
0 commit comments