Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion test/ex_webrtc/data_channel_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,15 @@ defmodule ExWebRTC.DataChannelTest do
assert_receive {:ex_webrtc, ^pc1, {:data, ^ref1, ^data}}
end

test "and collecting stats about it", %{pc1: pc1, pc2: pc2, ref1: ref1} do
test "and collecting stats about it", %{pc1: pc1, pc2: pc2, ref1: ref1, ref2: ref2} do
for _ <- 1..10 do
:ok = PeerConnection.send_data(pc1, ref1, <<1, 2, 3>>)
end

for _ <- 1..10 do
assert_receive {:ex_webrtc, ^pc2, {:data, ^ref2, <<1, 2, 3>>}}
end

stats1 = PeerConnection.get_stats(pc1)
assert {_ref, channel_stats1} = Enum.find(stats1, fn {_, v} -> v.type == :data_channel end)
assert channel_stats1.bytes_sent == 30
Expand Down
Loading