-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use new, struct-based ex_dtls
; add tests
#17
Conversation
|
||
{:ok, ice_agent} = ICEAgent.start_link(:controlled, ice_config) | ||
{:ok, ice_agent} = ice_module.start_link(:controlled, ice_config) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be perfect we should define a behavior for ice_module
but I don't insist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe let's let it be for now, especially considering that DTLSTransport
uses exactly one function from ICEAgent
API.
end | ||
|
||
test "forwards non-data ICE messages", %{dtls: dtls} do | ||
message = "test message" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better send some signaling message like connection state change albo gathering state change
send_ice(dtls, :connected) | ||
|
||
assert_receive {:fake_ice, _packets} | ||
assert_receive {:fake_ice, _retransmited}, 1200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert packets and retransmitted are the same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But they are not the same tho.
assert is_binary(packets) | ||
end | ||
|
||
test "finishes handshake in actice mode", %{dtls: dtls} do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test "finishes handshake in actice mode", %{dtls: dtls} do | |
test "finishes handshake in active mode", %{dtls: dtls} do |
end | ||
end | ||
|
||
defp send_ice(dtls, msg), do: send(dtls, {:ex_ice, "dummy_pid", msg}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would make this accept ice_pid instead i.e
defp send_ice(dtls, msg), do: send(dtls, {:ex_ice, "dummy_pid", msg}) | |
defp send_ice(ice_agent, msg), do: send(ice_agent, {:send, msg}) |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #17 +/- ##
==========================================
+ Coverage 74.47% 82.79% +8.31%
==========================================
Files 10 10
Lines 427 430 +3
==========================================
+ Hits 318 356 +38
+ Misses 109 74 -35
Continue to review full report in Codecov by Sentry.
|
No description provided.