Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ void connectsToTestPeer() throws Exception {
assertNotNull(result.network().connectTime());
assertNull(result.network().failure());
assertFalse(result.network().isRelayed());
assertEquals("host", result.network().candidateType());
// Direct; prflx where the host has a bridge, as in PeerTests.
assertTrue(Arrays.asList("host", "prflx").contains(result.network().candidateType()), result::toString);

// The check's own peer is closed, the test peer is the application's.
assertEquals(Collections.singletonList(testPeer), rtc.peers());
Expand Down
5 changes: 4 additions & 1 deletion webrtc/src/test/java/dev/onvoid/webrtc/client/PeerTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,10 @@ void statsAfterConnecting() throws Exception {
PeerStats first = await(peers[0].stats());
PeerStats second = await(peers[0].stats());

assertEquals("host", first.candidateType());
// Direct, but not always host: on a machine with a bridge, such as
// Docker's, the answer to a check may name another local address,
// which WebRTC then takes as a peer-reflexive candidate.
assertTrue(Arrays.asList("host", "prflx").contains(first.candidateType()), first::toString);
assertTrue(first.bytesSent() > 10_000, () -> "Bytes sent: " + first.bytesSent());
assertEquals(first.report().getTimestamp(), ChronoUnit.MICROS.between(Instant.EPOCH, first.timestamp()));
assertEquals(-1, first.outgoingBitrate());
Expand Down
Loading