Lines Matching refs:new
25 let a = Agent::new(config).await?; in test_pair_search()
51 let a = Agent::new(AgentConfig::default()).await?; in test_pair_priority()
63 let host_local: Arc<dyn Candidate + Send + Sync> = Arc::new(host_config.new_candidate_host()?); in test_pair_priority()
121 Arc::new(relay_remote), in test_pair_priority()
122 Arc::new(srflx_remote), in test_pair_priority()
123 Arc::new(prflx_remote), in test_pair_priority()
124 Arc::new(host_remote), in test_pair_priority()
189 let a = Agent::new(AgentConfig::default()).await?; in test_on_selected_candidate_pair_change()
191 let callback_called_tx = Arc::new(Mutex::new(Some(callback_called_tx))); in test_on_selected_candidate_pair_change()
192 let cb: OnSelectedCandidatePairChangeHdlrFn = Box::new(move |_, _| { in test_on_selected_candidate_pair_change()
228 let p = Arc::new(CandidatePair::new( in test_on_selected_candidate_pair_change()
229 Arc::new(host_local), in test_on_selected_candidate_pair_change()
230 Arc::new(relay_remote), in test_on_selected_candidate_pair_change()
244 let a = Agent::new(AgentConfig::default()).await?; in test_handle_peer_reflexive_udp_pflx_candidate()
252 conn: Some(Arc::new(MockConn {})), in test_handle_peer_reflexive_udp_pflx_candidate()
258 let local: Arc<dyn Candidate + Send + Sync> = Arc::new(host_config.new_candidate_host()?); in test_handle_peer_reflexive_udp_pflx_candidate()
270 let mut msg = Message::new(); in test_handle_peer_reflexive_udp_pflx_candidate()
272 Box::new(BINDING_REQUEST), in test_handle_peer_reflexive_udp_pflx_candidate()
273 Box::new(TransactionId::new()), in test_handle_peer_reflexive_udp_pflx_candidate()
274 Box::new(Username::new(ATTR_USERNAME, username)), in test_handle_peer_reflexive_udp_pflx_candidate()
275 Box::new(UseCandidateAttr::new()), in test_handle_peer_reflexive_udp_pflx_candidate()
276 Box::new(AttrControlling(tie_breaker)), in test_handle_peer_reflexive_udp_pflx_candidate()
277 Box::new(PriorityAttr(local.priority())), in test_handle_peer_reflexive_udp_pflx_candidate()
278 Box::new(MessageIntegrity::new_short_term_integrity(local_pwd)), in test_handle_peer_reflexive_udp_pflx_candidate()
279 Box::new(FINGERPRINT), in test_handle_peer_reflexive_udp_pflx_candidate()
326 let a = Agent::new(AgentConfig::default()).await?; in test_handle_peer_reflexive_unknown_remote()
351 conn: Some(Arc::new(MockConn {})), in test_handle_peer_reflexive_unknown_remote()
357 let local: Arc<dyn Candidate + Send + Sync> = Arc::new(host_config.new_candidate_host()?); in test_handle_peer_reflexive_unknown_remote()
360 let mut msg = Message::new(); in test_handle_peer_reflexive_unknown_remote()
362 Box::new(BINDING_SUCCESS), in test_handle_peer_reflexive_unknown_remote()
363 Box::new(tid), in test_handle_peer_reflexive_unknown_remote()
364 Box::new(MessageIntegrity::new_short_term_integrity(remote_pwd)), in test_handle_peer_reflexive_unknown_remote()
365 Box::new(FINGERPRINT), in test_handle_peer_reflexive_unknown_remote()
404 let wan = Arc::new(Mutex::new(router::Router::new(router::RouterConfig { in test_connectivity_on_startup()
409 let net0 = Arc::new(net::Net::new(Some(net::NetConfig { in test_connectivity_on_startup()
413 let net1 = Arc::new(net::Net::new(Some(net::NetConfig { in test_connectivity_on_startup()
437 let a_agent = Arc::new(Agent::new(cfg0).await?); in test_connectivity_on_startup()
450 let b_agent = Arc::new(Agent::new(cfg1).await?); in test_connectivity_on_startup()
464 let accepting_tx = Arc::new(Mutex::new(Some(accepting_tx))); in test_connectivity_on_startup()
465 a_agent.on_connection_state_change(Box::new(move |s: ConnectionState| { in test_connectivity_on_startup()
545 let a_agent = Arc::new(Agent::new(cfg0).await?); in test_connectivity_lite()
558 let b_agent = Arc::new(Agent::new(cfg1).await?); in test_connectivity_lite()
589 Ok((0, SocketAddr::new(Ipv4Addr::new(0, 0, 0, 0).into(), 0))) in recv_from()
605 Ok(SocketAddr::new(Ipv4Addr::new(0, 0, 0, 0).into(), 0)) in local_addr()
618 let mut msg = Message::new(); in build_msg()
620 Box::new(MessageType::new(METHOD_BINDING, c)), in build_msg()
621 Box::new(TransactionId::new()), in build_msg()
622 Box::new(Username::new(ATTR_USERNAME, username)), in build_msg()
623 Box::new(MessageIntegrity::new_short_term_integrity(key)), in build_msg()
624 Box::new(FINGERPRINT), in build_msg()
647 let local: Arc<dyn Candidate + Send + Sync> = Arc::new( in test_inbound_validity()
654 conn: Some(Arc::new(MockPacketConn {})), in test_inbound_validity()
664 let a = Agent::new(AgentConfig::default()).await?; in test_inbound_validity()
713 let a = Agent::new(AgentConfig::default()).await?; in test_inbound_validity()
742 let a = Agent::new(AgentConfig::default()).await?; in test_inbound_validity()
769 let a = Agent::new(AgentConfig::default()).await?; in test_inbound_validity()
799 let a = Agent::new(AgentConfig::default()).await?; in test_inbound_validity()
810 let mut msg = Message::new(); in test_inbound_validity()
812 Box::new(BINDING_REQUEST), in test_inbound_validity()
813 Box::new(TransactionId::new()), in test_inbound_validity()
814 Box::new(Username::new(ATTR_USERNAME, username)), in test_inbound_validity()
815 Box::new(MessageIntegrity::new_short_term_integrity(local_pwd)), in test_inbound_validity()
832 let a = Agent::new(AgentConfig::default()).await?; in test_inbound_validity()
845 let mut msg = Message::new(); in test_inbound_validity()
847 Box::new(BINDING_SUCCESS), in test_inbound_validity()
848 Box::new(t_id), in test_inbound_validity()
849 Box::new(MessageIntegrity::new_short_term_integrity(remote_pwd)), in test_inbound_validity()
850 Box::new(FINGERPRINT), in test_inbound_validity()
873 let a = Agent::new(AgentConfig::default()).await?; in test_invalid_agent_starts()
955 let a_agent = Arc::new(Agent::new(cfg0).await?); in test_connection_state_callback()
956 let b_agent = Arc::new(Agent::new(cfg1).await?); in test_connection_state_callback()
964 let is_checking_tx = Arc::new(Mutex::new(Some(is_checking_tx))); in test_connection_state_callback()
965 let is_connected_tx = Arc::new(Mutex::new(Some(is_connected_tx))); in test_connection_state_callback()
966 let is_disconnected_tx = Arc::new(Mutex::new(Some(is_disconnected_tx))); in test_connection_state_callback()
967 let is_failed_tx = Arc::new(Mutex::new(Some(is_failed_tx))); in test_connection_state_callback()
968 let is_closed_tx = Arc::new(Mutex::new(Some(is_closed_tx))); in test_connection_state_callback()
970 a_agent.on_connection_state_change(Box::new(move |c: ConnectionState| { in test_connection_state_callback()
1031 let a = Agent::new(AgentConfig::default()).await?; in test_invalid_gather()
1048 let a = Agent::new(AgentConfig::default()).await?; in test_candidate_pair_stats()
1050 let host_local: Arc<dyn Candidate + Send + Sync> = Arc::new( in test_candidate_pair_stats()
1064 let relay_remote: Arc<dyn Candidate + Send + Sync> = Arc::new( in test_candidate_pair_stats()
1080 let srflx_remote: Arc<dyn Candidate + Send + Sync> = Arc::new( in test_candidate_pair_stats()
1095 let prflx_remote: Arc<dyn Candidate + Send + Sync> = Arc::new( in test_candidate_pair_stats()
1110 let host_remote: Arc<dyn Candidate + Send + Sync> = Arc::new( in test_candidate_pair_stats()
1210 let a = Agent::new(AgentConfig::default()).await?; in test_local_candidate_stats()
1212 let host_local: Arc<dyn Candidate + Send + Sync> = Arc::new( in test_local_candidate_stats()
1226 let srflx_local: Arc<dyn Candidate + Send + Sync> = Arc::new( in test_local_candidate_stats()
1301 let a = Agent::new(AgentConfig::default()).await?; in test_remote_candidate_stats()
1303 let relay_remote: Arc<dyn Candidate + Send + Sync> = Arc::new( in test_remote_candidate_stats()
1319 let srflx_remote: Arc<dyn Candidate + Send + Sync> = Arc::new( in test_remote_candidate_stats()
1334 let prflx_remote: Arc<dyn Candidate + Send + Sync> = Arc::new( in test_remote_candidate_stats()
1349 let host_remote: Arc<dyn Candidate + Send + Sync> = Arc::new( in test_remote_candidate_stats()
1449 let a = Agent::new(AgentConfig::default()).await?; in test_init_ext_ip_mapping()
1457 let a = Agent::new(AgentConfig { in test_init_ext_ip_mapping()
1471 if let Err(err) = Agent::new(AgentConfig { in test_init_ext_ip_mapping()
1490 if let Err(err) = Agent::new(AgentConfig { in test_init_ext_ip_mapping()
1509 if let Err(err) = Agent::new(AgentConfig { in test_init_ext_ip_mapping()
1527 if let Err(err) = Agent::new(AgentConfig { in test_init_ext_ip_mapping()
1550 let a = Agent::new(AgentConfig::default()).await?; in test_binding_request_timeout()
1593 let a = Agent::new(AgentConfig::default()).await?; in test_agent_credentials()
1606 if let Err(err) = Agent::new(AgentConfig { in test_agent_credentials()
1617 if let Err(err) = Agent::new(AgentConfig { in test_agent_credentials()
1653 let a_agent = Arc::new(Agent::new(cfg0).await?); in test_connection_state_failed_delete_all_candidates()
1654 let b_agent = Arc::new(Agent::new(cfg1).await?); in test_connection_state_failed_delete_all_candidates()
1657 let is_failed_tx = Arc::new(Mutex::new(Some(is_failed_tx))); in test_connection_state_failed_delete_all_candidates()
1658 a_agent.on_connection_state_change(Box::new(move |c: ConnectionState| { in test_connection_state_failed_delete_all_candidates()
1707 let a_agent = Arc::new(Agent::new(cfg0).await?); in test_connection_state_connecting_to_failed()
1708 let b_agent = Arc::new(Agent::new(cfg1).await?); in test_connection_state_connecting_to_failed()
1710 let is_failed = WaitGroup::new(); in test_connection_state_connecting_to_failed()
1711 let is_checking = WaitGroup::new(); in test_connection_state_connecting_to_failed()
1714 let wf = Arc::new(Mutex::new(Some(wf))); in test_connection_state_connecting_to_failed()
1715 let wc = Arc::new(Mutex::new(Some(wc))); in test_connection_state_connecting_to_failed()
1716 let hdlr_fn: OnConnectionStateChangeHdlrFn = Box::new(move |c: ConnectionState| { in test_connection_state_connecting_to_failed()
1771 let agent = Agent::new(AgentConfig::default()).await?; in test_agent_restart_during_gather()
1792 let agent = Agent::new(AgentConfig::default()).await?; in test_agent_restart_when_closed()
1824 let cancel_tx = Arc::new(Mutex::new(Some(cancel_tx))); in test_agent_restart_one_side()
1825 agent_b.on_connection_state_change(Box::new(move |c: ConnectionState| { in test_agent_restart_one_side()
1855 let mut out = String::new(); in test_agent_restart_both_side()
1927 let a = Agent::new(AgentConfig::default()).await?; in test_get_remote_credentials()
1975 let a_agent = Arc::new(Agent::new(cfg0).await?); in test_close_in_connection_state_callback()
1976 let b_agent = Arc::new(Agent::new(cfg1).await?); in test_close_in_connection_state_callback()
1980 let is_closed_tx = Arc::new(Mutex::new(Some(is_closed_tx))); in test_close_in_connection_state_callback()
1981 let is_connected_tx = Arc::new(Mutex::new(Some(is_connected_tx))); in test_close_in_connection_state_callback()
1982 a_agent.on_connection_state_change(Box::new(move |c: ConnectionState| { in test_close_in_connection_state_callback()
2032 let a_agent = Arc::new(Agent::new(cfg0).await?); in test_run_task_in_connection_state_callback()
2033 let b_agent = Arc::new(Agent::new(cfg1).await?); in test_run_task_in_connection_state_callback()
2036 let is_complete_tx = Arc::new(Mutex::new(Some(is_complete_tx))); in test_run_task_in_connection_state_callback()
2037 a_agent.on_connection_state_change(Box::new(move |c: ConnectionState| { in test_run_task_in_connection_state_callback()
2084 let a_agent = Arc::new(Agent::new(cfg0).await?); in test_run_task_in_selected_candidate_pair_change_callback()
2085 let b_agent = Arc::new(Agent::new(cfg1).await?); in test_run_task_in_selected_candidate_pair_change_callback()
2088 let is_tested_tx = Arc::new(Mutex::new(Some(is_tested_tx))); in test_run_task_in_selected_candidate_pair_change_callback()
2089 a_agent.on_selected_candidate_pair_change(Box::new( in test_run_task_in_selected_candidate_pair_change_callback()
2100 let is_complete_tx = Arc::new(Mutex::new(Some(is_complete_tx))); in test_run_task_in_selected_candidate_pair_change_callback()
2101 a_agent.on_connection_state_change(Box::new(move |c: ConnectionState| { in test_run_task_in_selected_candidate_pair_change_callback()
2129 let a_agent = Arc::new( in test_lite_lifecycle()
2130 Agent::new(AgentConfig { in test_lite_lifecycle()
2144 let b_agent = Arc::new( in test_lite_lifecycle()
2145 Agent::new(AgentConfig { in test_lite_lifecycle()
2162 let b_connected_tx = Arc::new(Mutex::new(Some(b_connected_tx))); in test_lite_lifecycle()
2163 let b_disconnected_tx = Arc::new(Mutex::new(Some(b_disconnected_tx))); in test_lite_lifecycle()
2164 let b_failed_tx = Arc::new(Mutex::new(Some(b_failed_tx))); in test_lite_lifecycle()
2166 b_agent.on_connection_state_change(Box::new(move |c: ConnectionState| { in test_lite_lifecycle()