style: rename test methods from snake_case to camelCase
https://claude.ai/code/session_01AfRYTRCvtKqqDxeKQujUrx
This commit is contained in:
+50
-50
@@ -200,7 +200,7 @@ class CallManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun incomingCallFromFollowedUser_transitionsToIncomingCall() =
|
fun incomingCallFromFollowedUserTransitionsToIncomingCall() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = bob)
|
val (manager, _) = createManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -216,7 +216,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun incomingCallFromNonFollowed_isIgnored() =
|
fun incomingCallFromNonFollowedIsIgnored() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = bob, followedKeys = emptySet())
|
val (manager, _) = createManager(localPubKey = bob, followedKeys = emptySet())
|
||||||
|
|
||||||
@@ -227,7 +227,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun acceptingCall_transitionsToConnecting() =
|
fun acceptingCallTransitionsToConnecting() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = bob)
|
val (manager, _) = createManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -243,7 +243,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun peerConnected_transitionsConnectingToConnected() =
|
fun peerConnectedTransitionsConnectingToConnected() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = bob)
|
val (manager, _) = createManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -259,7 +259,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun peerHangup_endsConnectedCall() =
|
fun peerHangupEndsConnectedCall() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = bob)
|
val (manager, _) = createManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -277,7 +277,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun endedState_autoResetsToIdle() =
|
fun endedStateAutoResetsToIdle() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = bob)
|
val (manager, _) = createManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -299,7 +299,7 @@ class CallManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun initiateCall_transitionsToOffering() =
|
fun initiateCallTransitionsToOffering() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = alice)
|
val (manager, _) = createManager(localPubKey = alice)
|
||||||
|
|
||||||
@@ -313,7 +313,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun receivingAnswer_transitionsOfferingToConnecting() =
|
fun receivingAnswerTransitionsOfferingToConnecting() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = alice, followedKeys = setOf(bob))
|
val (manager, _) = createManager(localPubKey = alice, followedKeys = setOf(bob))
|
||||||
|
|
||||||
@@ -336,7 +336,7 @@ class CallManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun rejectingIncomingCall_transitionsToEnded() =
|
fun rejectingIncomingCallTransitionsToEnded() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = bob)
|
val (manager, _) = createManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -351,7 +351,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun receivingReject_endsOfferingCall() =
|
fun receivingRejectEndsOfferingCall() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = alice, followedKeys = setOf(bob))
|
val (manager, _) = createManager(localPubKey = alice, followedKeys = setOf(bob))
|
||||||
|
|
||||||
@@ -371,7 +371,7 @@ class CallManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun incomingCallWhileInActiveCall_autoRejectsBusy() =
|
fun incomingCallWhileInActiveCallAutoRejectsBusy() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, published) = createManager(localPubKey = bob)
|
val (manager, published) = createManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -399,7 +399,7 @@ class CallManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun staleEvents_areDiscarded() =
|
fun staleEventsAreDiscarded() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = bob)
|
val (manager, _) = createManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -411,7 +411,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun freshEvents_areProcessed() =
|
fun freshEventsAreProcessed() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = bob)
|
val (manager, _) = createManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -427,7 +427,7 @@ class CallManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun duplicateEvents_areIgnored() =
|
fun duplicateEventsAreIgnored() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = bob)
|
val (manager, _) = createManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -451,7 +451,7 @@ class CallManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun selfIceCandidates_areAlwaysIgnored() =
|
fun selfIceCandidatesAreAlwaysIgnored() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = bob)
|
val (manager, _) = createManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -469,7 +469,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun selfHangup_isAlwaysIgnored() =
|
fun selfHangupIsAlwaysIgnored() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = bob)
|
val (manager, _) = createManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -487,7 +487,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun selfAnswer_inIncomingCall_meansAnsweredElsewhere() =
|
fun selfAnswerInIncomingCallMeansAnsweredElsewhere() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = bob)
|
val (manager, _) = createManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -504,7 +504,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun selfAnswer_inOfferingState_isIgnored() =
|
fun selfAnswerInOfferingStateIsIgnored() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = alice, followedKeys = setOf(bob))
|
val (manager, _) = createManager(localPubKey = alice, followedKeys = setOf(bob))
|
||||||
|
|
||||||
@@ -523,7 +523,7 @@ class CallManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun iceCandidates_areForwardedViaCallback() =
|
fun iceCandidatesAreForwardedViaCallback() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = bob)
|
val (manager, _) = createManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -544,7 +544,7 @@ class CallManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun renegotiation_inConnectedState_isForwarded() =
|
fun renegotiationInConnectedStateIsForwarded() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = bob)
|
val (manager, _) = createManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -563,7 +563,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun renegotiation_inConnectingState_isForwarded() =
|
fun renegotiationInConnectingStateIsForwarded() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = bob)
|
val (manager, _) = createManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -581,7 +581,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun renegotiation_inIdleState_isIgnored() =
|
fun renegotiationInIdleStateIsIgnored() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = bob)
|
val (manager, _) = createManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -596,7 +596,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun renegotiation_wrongCallId_isIgnored() =
|
fun renegotiationWrongCallIdIsIgnored() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = bob)
|
val (manager, _) = createManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -618,7 +618,7 @@ class CallManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun hangup_fromOffering_transitionsToEnded() =
|
fun hangupFromOfferingTransitionsToEnded() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = alice, followedKeys = setOf(bob))
|
val (manager, _) = createManager(localPubKey = alice, followedKeys = setOf(bob))
|
||||||
|
|
||||||
@@ -633,7 +633,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun hangup_fromConnecting_transitionsToEnded() =
|
fun hangupFromConnectingTransitionsToEnded() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = bob)
|
val (manager, _) = createManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -647,7 +647,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun hangup_fromConnected_transitionsToEnded() =
|
fun hangupFromConnectedTransitionsToEnded() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = bob)
|
val (manager, _) = createManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -663,7 +663,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun hangup_fromIdle_isNoop() =
|
fun hangupFromIdleIsNoop() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, published) = createManager(localPubKey = bob)
|
val (manager, published) = createManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -678,7 +678,7 @@ class CallManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun groupCallOffer_detectsMultipleMembers() =
|
fun groupCallOfferDetectsMultipleMembers() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = bob)
|
val (manager, _) = createManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -691,7 +691,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun groupCall_peerReject_removesFromGroup() =
|
fun groupCallPeerRejectRemovesFromGroup() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = alice, followedKeys = setOf(bob, carol))
|
val (manager, _) = createManager(localPubKey = alice, followedKeys = setOf(bob, carol))
|
||||||
|
|
||||||
@@ -709,7 +709,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun groupCall_allPeersReject_endsCall() =
|
fun groupCallAllPeersRejectEndsCall() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = alice, followedKeys = setOf(bob, carol))
|
val (manager, _) = createManager(localPubKey = alice, followedKeys = setOf(bob, carol))
|
||||||
|
|
||||||
@@ -722,7 +722,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun groupCall_partialDisconnect_continuesWithRemainingPeers() =
|
fun groupCallPartialDisconnectContinuesWithRemainingPeers() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = alice, followedKeys = setOf(bob, carol))
|
val (manager, _) = createManager(localPubKey = alice, followedKeys = setOf(bob, carol))
|
||||||
|
|
||||||
@@ -750,7 +750,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun groupCall_lastPeerLeaves_endsCall() =
|
fun groupCallLastPeerLeavesEndsCall() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = alice, followedKeys = setOf(bob, carol))
|
val (manager, _) = createManager(localPubKey = alice, followedKeys = setOf(bob, carol))
|
||||||
|
|
||||||
@@ -775,7 +775,7 @@ class CallManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun groupCall_discoversPeerWhileRinging() =
|
fun groupCallDiscoversPeerWhileRinging() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = bob)
|
val (manager, _) = createManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -807,7 +807,7 @@ class CallManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun midCallOffer_sameCallId_isForwardedAsMidCallOffer() =
|
fun midCallOfferSameCallIdIsForwardedAsMidCallOffer() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = bob, followedKeys = setOf(alice, carol))
|
val (manager, _) = createManager(localPubKey = bob, followedKeys = setOf(alice, carol))
|
||||||
|
|
||||||
@@ -836,7 +836,7 @@ class CallManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun answer_wrongCallId_isIgnored() =
|
fun answerWrongCallIdIsIgnored() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = alice, followedKeys = setOf(bob))
|
val (manager, _) = createManager(localPubKey = alice, followedKeys = setOf(bob))
|
||||||
|
|
||||||
@@ -850,7 +850,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun hangup_wrongCallId_isIgnored() =
|
fun hangupWrongCallIdIsIgnored() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = bob)
|
val (manager, _) = createManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -870,7 +870,7 @@ class CallManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun peerLeft_callback_firesOnHangup() =
|
fun peerLeftCallbackFiresOnHangup() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = alice, followedKeys = setOf(bob, carol))
|
val (manager, _) = createManager(localPubKey = alice, followedKeys = setOf(bob, carol))
|
||||||
|
|
||||||
@@ -892,7 +892,7 @@ class CallManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun reset_returnsToIdle() =
|
fun resetReturnsToIdle() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = bob)
|
val (manager, _) = createManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -909,7 +909,7 @@ class CallManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun videoCallType_preservedThroughStates() =
|
fun videoCallTypePreservedThroughStates() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = bob)
|
val (manager, _) = createManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -936,7 +936,7 @@ class CallManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun callerHangup_whileRinging_endsIncomingCall() =
|
fun callerHangupWhileRingingEndsIncomingCall() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, _) = createManager(localPubKey = bob)
|
val (manager, _) = createManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -957,7 +957,7 @@ class CallManagerTest {
|
|||||||
// the full pipeline: CallManager → WebRtcCallFactory → sign → gift wrap → publish
|
// the full pipeline: CallManager → WebRtcCallFactory → sign → gift wrap → publish
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun interface_initiateCall_publishesGiftWrappedOffer() =
|
fun interfaceInitiateCallPublishesGiftWrappedOffer() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, published) = createManager(localPubKey = alice, followedKeys = setOf(bob))
|
val (manager, published) = createManager(localPubKey = alice, followedKeys = setOf(bob))
|
||||||
|
|
||||||
@@ -969,7 +969,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun interface_acceptCall_publishesGiftWrappedAnswer() =
|
fun interfaceAcceptCallPublishesGiftWrappedAnswer() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, published) = createManager(localPubKey = bob, followedKeys = setOf(alice))
|
val (manager, published) = createManager(localPubKey = bob, followedKeys = setOf(alice))
|
||||||
|
|
||||||
@@ -990,7 +990,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun interface_rejectCall_publishesGiftWrappedReject() =
|
fun interfaceRejectCallPublishesGiftWrappedReject() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, published) = createManager(localPubKey = bob, followedKeys = setOf(alice))
|
val (manager, published) = createManager(localPubKey = bob, followedKeys = setOf(alice))
|
||||||
|
|
||||||
@@ -1006,7 +1006,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun interface_hangup_publishesGiftWrappedHangup() =
|
fun interfaceHangupPublishesGiftWrappedHangup() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, published) = createManager(localPubKey = bob, followedKeys = setOf(alice))
|
val (manager, published) = createManager(localPubKey = bob, followedKeys = setOf(alice))
|
||||||
|
|
||||||
@@ -1024,7 +1024,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun interface_sendRenegotiation_publishesGiftWrappedRenegotiate() =
|
fun interfaceSendRenegotiationPublishesGiftWrappedRenegotiate() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, published) = createManager(localPubKey = bob, followedKeys = setOf(alice))
|
val (manager, published) = createManager(localPubKey = bob, followedKeys = setOf(alice))
|
||||||
|
|
||||||
@@ -1043,7 +1043,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun interface_sendRenegotiationAnswer_publishesGiftWrappedAnswer() =
|
fun interfaceSendRenegotiationAnswerPublishesGiftWrappedAnswer() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, published) = createManager(localPubKey = bob, followedKeys = setOf(alice))
|
val (manager, published) = createManager(localPubKey = bob, followedKeys = setOf(alice))
|
||||||
|
|
||||||
@@ -1060,7 +1060,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun interface_busyAutoReject_publishesRejectEvent() =
|
fun interfaceBusyAutoRejectPublishesRejectEvent() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, published) = createManager(localPubKey = bob, followedKeys = setOf(alice, carol))
|
val (manager, published) = createManager(localPubKey = bob, followedKeys = setOf(alice, carol))
|
||||||
|
|
||||||
@@ -1083,7 +1083,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun interface_groupCall_publishesPerPeerOffers() =
|
fun interfaceGroupCallPublishesPerPeerOffers() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, published) = createManager(localPubKey = alice, followedKeys = setOf(bob, carol))
|
val (manager, published) = createManager(localPubKey = alice, followedKeys = setOf(bob, carol))
|
||||||
|
|
||||||
@@ -1097,7 +1097,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun interface_invitePeer_publishesOfferToNewPeer() =
|
fun interfaceInvitePeerPublishesOfferToNewPeer() =
|
||||||
runTest {
|
runTest {
|
||||||
val (manager, published) = createManager(localPubKey = alice, followedKeys = setOf(bob))
|
val (manager, published) = createManager(localPubKey = alice, followedKeys = setOf(bob))
|
||||||
|
|
||||||
@@ -1118,7 +1118,7 @@ class CallManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun interface_fullP2PCallFlow_withRealSigners() =
|
fun interfaceFullP2PCallFlowWithRealSigners() =
|
||||||
runTest {
|
runTest {
|
||||||
// Full end-to-end P2P call: Alice calls Bob
|
// Full end-to-end P2P call: Alice calls Bob
|
||||||
val (aliceManager, alicePublished) = createManager(localPubKey = alice, followedKeys = setOf(bob))
|
val (aliceManager, alicePublished) = createManager(localPubKey = alice, followedKeys = setOf(bob))
|
||||||
|
|||||||
+24
-24
@@ -47,7 +47,7 @@ class PeerSessionManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun iceCandidate_noSession_bufferedGlobally() {
|
fun iceCandidateNoSessionBufferedGlobally() {
|
||||||
val manager = PeerSessionManager(localPubKey = bob)
|
val manager = PeerSessionManager(localPubKey = bob)
|
||||||
val candidate = makeCandidate("early-candidate")
|
val candidate = makeCandidate("early-candidate")
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ class PeerSessionManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun multipleGlobalCandidates_bufferedForSamePeer() {
|
fun multipleGlobalCandidatesBufferedForSamePeer() {
|
||||||
val manager = PeerSessionManager(localPubKey = bob)
|
val manager = PeerSessionManager(localPubKey = bob)
|
||||||
|
|
||||||
manager.routeIceCandidate(alice, makeCandidate("c1"))
|
manager.routeIceCandidate(alice, makeCandidate("c1"))
|
||||||
@@ -69,7 +69,7 @@ class PeerSessionManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun globalBuffer_drainedOnSessionCreation() {
|
fun globalBufferDrainedOnSessionCreation() {
|
||||||
val manager = PeerSessionManager(localPubKey = bob)
|
val manager = PeerSessionManager(localPubKey = bob)
|
||||||
val fake = FakePeerSession()
|
val fake = FakePeerSession()
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ class PeerSessionManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun globalBuffer_drainedAndFlushedAfterRemoteDescription() {
|
fun globalBufferDrainedAndFlushedAfterRemoteDescription() {
|
||||||
val manager = PeerSessionManager(localPubKey = bob)
|
val manager = PeerSessionManager(localPubKey = bob)
|
||||||
val fake = FakePeerSession()
|
val fake = FakePeerSession()
|
||||||
|
|
||||||
@@ -115,7 +115,7 @@ class PeerSessionManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun iceCandidate_sessionExists_remoteDescNotSet_bufferedPerSession() {
|
fun iceCandidateSessionExistsRemoteDescNotSetBufferedPerSession() {
|
||||||
val manager = PeerSessionManager(localPubKey = bob)
|
val manager = PeerSessionManager(localPubKey = bob)
|
||||||
val fake = FakePeerSession()
|
val fake = FakePeerSession()
|
||||||
manager.registerSession(alice, fake)
|
manager.registerSession(alice, fake)
|
||||||
@@ -128,7 +128,7 @@ class PeerSessionManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun iceCandidate_sessionExists_remoteDescSet_addedDirectly() {
|
fun iceCandidateSessionExistsRemoteDescSetAddedDirectly() {
|
||||||
val manager = PeerSessionManager(localPubKey = bob)
|
val manager = PeerSessionManager(localPubKey = bob)
|
||||||
val fake = FakePeerSession()
|
val fake = FakePeerSession()
|
||||||
manager.registerSession(alice, fake)
|
manager.registerSession(alice, fake)
|
||||||
@@ -142,7 +142,7 @@ class PeerSessionManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun perSessionBuffer_notClearedOnSessionCreation_onlyOnFlush() {
|
fun perSessionBufferNotClearedOnSessionCreationOnlyOnFlush() {
|
||||||
val manager = PeerSessionManager(localPubKey = bob)
|
val manager = PeerSessionManager(localPubKey = bob)
|
||||||
val fake = FakePeerSession()
|
val fake = FakePeerSession()
|
||||||
|
|
||||||
@@ -171,7 +171,7 @@ class PeerSessionManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun candidatesBufferedWhileRinging_notLost_whenAccepting() {
|
fun candidatesBufferedWhileRingingNotLostWhenAccepting() {
|
||||||
val manager = PeerSessionManager(localPubKey = bob)
|
val manager = PeerSessionManager(localPubKey = bob)
|
||||||
val fake = FakePeerSession()
|
val fake = FakePeerSession()
|
||||||
|
|
||||||
@@ -198,7 +198,7 @@ class PeerSessionManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun globalBuffers_areSeparatePerPeer() {
|
fun globalBuffersAreSeparatePerPeer() {
|
||||||
val manager = PeerSessionManager(localPubKey = bob)
|
val manager = PeerSessionManager(localPubKey = bob)
|
||||||
|
|
||||||
manager.routeIceCandidate(alice, makeCandidate("alice-c"))
|
manager.routeIceCandidate(alice, makeCandidate("alice-c"))
|
||||||
@@ -209,7 +209,7 @@ class PeerSessionManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun registeringOneSession_doesNotDrainOtherPeersGlobalBuffer() {
|
fun registeringOneSessionDoesNotDrainOtherPeersGlobalBuffer() {
|
||||||
val manager = PeerSessionManager(localPubKey = bob)
|
val manager = PeerSessionManager(localPubKey = bob)
|
||||||
|
|
||||||
manager.routeIceCandidate(alice, makeCandidate("alice-c"))
|
manager.routeIceCandidate(alice, makeCandidate("alice-c"))
|
||||||
@@ -226,7 +226,7 @@ class PeerSessionManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun renegotiation_noGlare_acceptsRemoteOffer() {
|
fun renegotiationNoGlareAcceptsRemoteOffer() {
|
||||||
val manager = PeerSessionManager(localPubKey = bob)
|
val manager = PeerSessionManager(localPubKey = bob)
|
||||||
val fake = FakePeerSession(signalingState = SignalingState.STABLE)
|
val fake = FakePeerSession(signalingState = SignalingState.STABLE)
|
||||||
manager.registerSession(alice, fake)
|
manager.registerSession(alice, fake)
|
||||||
@@ -242,7 +242,7 @@ class PeerSessionManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun renegotiationGlare_localWins_higherPubkey() {
|
fun renegotiationGlareLocalWinsHigherPubkey() {
|
||||||
// carol (higher) is local, alice (lower) is remote → carol wins
|
// carol (higher) is local, alice (lower) is remote → carol wins
|
||||||
val manager = PeerSessionManager(localPubKey = carol)
|
val manager = PeerSessionManager(localPubKey = carol)
|
||||||
val fake = FakePeerSession(signalingState = SignalingState.HAVE_LOCAL_OFFER)
|
val fake = FakePeerSession(signalingState = SignalingState.HAVE_LOCAL_OFFER)
|
||||||
@@ -257,7 +257,7 @@ class PeerSessionManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun renegotiationGlare_remoteWins_rollback() {
|
fun renegotiationGlareRemoteWinsRollback() {
|
||||||
// alice (lower) is local, carol (higher) is remote → carol wins, alice rolls back
|
// alice (lower) is local, carol (higher) is remote → carol wins, alice rolls back
|
||||||
val manager = PeerSessionManager(localPubKey = alice)
|
val manager = PeerSessionManager(localPubKey = alice)
|
||||||
val fake = FakePeerSession(signalingState = SignalingState.HAVE_LOCAL_OFFER)
|
val fake = FakePeerSession(signalingState = SignalingState.HAVE_LOCAL_OFFER)
|
||||||
@@ -273,7 +273,7 @@ class PeerSessionManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun renegotiationGlare_noSession_returnsNoSession() {
|
fun renegotiationGlareNoSessionReturnsNoSession() {
|
||||||
val manager = PeerSessionManager(localPubKey = bob)
|
val manager = PeerSessionManager(localPubKey = bob)
|
||||||
|
|
||||||
val resolution =
|
val resolution =
|
||||||
@@ -287,7 +287,7 @@ class PeerSessionManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun meshInitiation_lowerPubkey_shouldInitiate() {
|
fun meshInitiationLowerPubkeyShouldInitiate() {
|
||||||
val manager = PeerSessionManager(localPubKey = alice)
|
val manager = PeerSessionManager(localPubKey = alice)
|
||||||
|
|
||||||
assertTrue(manager.shouldInitiateOffer(bob), "Lower pubkey (alice) should initiate to higher (bob)")
|
assertTrue(manager.shouldInitiateOffer(bob), "Lower pubkey (alice) should initiate to higher (bob)")
|
||||||
@@ -295,7 +295,7 @@ class PeerSessionManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun meshInitiation_higherPubkey_shouldWait() {
|
fun meshInitiationHigherPubkeyShouldWait() {
|
||||||
val manager = PeerSessionManager(localPubKey = carol)
|
val manager = PeerSessionManager(localPubKey = carol)
|
||||||
|
|
||||||
assertFalse(manager.shouldInitiateOffer(alice), "Higher pubkey (carol) should NOT initiate to lower (alice)")
|
assertFalse(manager.shouldInitiateOffer(alice), "Higher pubkey (carol) should NOT initiate to lower (alice)")
|
||||||
@@ -307,7 +307,7 @@ class PeerSessionManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun routeAnswer_noSession_returnsNoSession() {
|
fun routeAnswerNoSessionReturnsNoSession() {
|
||||||
val manager = PeerSessionManager(localPubKey = alice)
|
val manager = PeerSessionManager(localPubKey = alice)
|
||||||
|
|
||||||
val action = manager.routeAnswer(bob, "answer-sdp")
|
val action = manager.routeAnswer(bob, "answer-sdp")
|
||||||
@@ -316,7 +316,7 @@ class PeerSessionManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun routeAnswer_wrongSignalingState_ignored() {
|
fun routeAnswerWrongSignalingStateIgnored() {
|
||||||
val manager = PeerSessionManager(localPubKey = alice)
|
val manager = PeerSessionManager(localPubKey = alice)
|
||||||
val fake = FakePeerSession(signalingState = SignalingState.STABLE)
|
val fake = FakePeerSession(signalingState = SignalingState.STABLE)
|
||||||
manager.registerSession(bob, fake)
|
manager.registerSession(bob, fake)
|
||||||
@@ -328,7 +328,7 @@ class PeerSessionManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun routeAnswer_havingLocalOffer_applied() {
|
fun routeAnswerHavingLocalOfferApplied() {
|
||||||
val manager = PeerSessionManager(localPubKey = alice)
|
val manager = PeerSessionManager(localPubKey = alice)
|
||||||
val fake = FakePeerSession(signalingState = SignalingState.HAVE_LOCAL_OFFER)
|
val fake = FakePeerSession(signalingState = SignalingState.HAVE_LOCAL_OFFER)
|
||||||
manager.registerSession(bob, fake)
|
manager.registerSession(bob, fake)
|
||||||
@@ -351,7 +351,7 @@ class PeerSessionManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun removeSession_disposesAndCleansUp() {
|
fun removeSessionDisposesAndCleansUp() {
|
||||||
val manager = PeerSessionManager(localPubKey = bob)
|
val manager = PeerSessionManager(localPubKey = bob)
|
||||||
val fake = FakePeerSession()
|
val fake = FakePeerSession()
|
||||||
manager.registerSession(alice, fake)
|
manager.registerSession(alice, fake)
|
||||||
@@ -365,7 +365,7 @@ class PeerSessionManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun disposeAll_disposesAllSessions() {
|
fun disposeAllDisposesAllSessions() {
|
||||||
val manager = PeerSessionManager(localPubKey = bob)
|
val manager = PeerSessionManager(localPubKey = bob)
|
||||||
val fakeAlice = FakePeerSession()
|
val fakeAlice = FakePeerSession()
|
||||||
val fakeCarol = FakePeerSession()
|
val fakeCarol = FakePeerSession()
|
||||||
@@ -384,7 +384,7 @@ class PeerSessionManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun fullP2PFlow_iceBufferingThroughAllPhases() {
|
fun fullP2PFlowIceBufferingThroughAllPhases() {
|
||||||
val manager = PeerSessionManager(localPubKey = bob)
|
val manager = PeerSessionManager(localPubKey = bob)
|
||||||
val fake = FakePeerSession()
|
val fake = FakePeerSession()
|
||||||
|
|
||||||
@@ -417,7 +417,7 @@ class PeerSessionManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun groupCall_meshSetup_withIceBuffering() {
|
fun groupCallMeshSetupWithIceBuffering() {
|
||||||
// Bob is local. Alice (caller) and Carol (other callee) are peers.
|
// Bob is local. Alice (caller) and Carol (other callee) are peers.
|
||||||
val manager = PeerSessionManager(localPubKey = bob)
|
val manager = PeerSessionManager(localPubKey = bob)
|
||||||
|
|
||||||
@@ -454,7 +454,7 @@ class PeerSessionManagerTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun renegotiationGlare_fullFlow_lowerPubkeyRollsBack() {
|
fun renegotiationGlareFullFlowLowerPubkeyRollsBack() {
|
||||||
// Alice (lower) and Bob (higher) both send renegotiation offers simultaneously
|
// Alice (lower) and Bob (higher) both send renegotiation offers simultaneously
|
||||||
// Alice's manager handles Bob's incoming offer
|
// Alice's manager handles Bob's incoming offer
|
||||||
val aliceManager = PeerSessionManager(localPubKey = alice)
|
val aliceManager = PeerSessionManager(localPubKey = alice)
|
||||||
|
|||||||
+20
-20
@@ -74,7 +74,7 @@ class NipACGiftWrapRoundTripTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun callOffer_roundTrips_throughGiftWrap() =
|
fun callOfferRoundTripsThroughGiftWrap() =
|
||||||
runTest {
|
runTest {
|
||||||
val result = factory.createCallOffer(sdpOffer, bob, callId, CallType.VIDEO, aliceSigner)
|
val result = factory.createCallOffer(sdpOffer, bob, callId, CallType.VIDEO, aliceSigner)
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ class NipACGiftWrapRoundTripTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun callOffer_cannotBeDecrypted_byThirdParty() =
|
fun callOfferCannotBeDecryptedByThirdParty() =
|
||||||
runTest {
|
runTest {
|
||||||
val result = factory.createCallOffer(sdpOffer, bob, callId, CallType.VOICE, aliceSigner)
|
val result = factory.createCallOffer(sdpOffer, bob, callId, CallType.VOICE, aliceSigner)
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ class NipACGiftWrapRoundTripTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun callAnswer_roundTrips_throughGiftWrap() =
|
fun callAnswerRoundTripsThroughGiftWrap() =
|
||||||
runTest {
|
runTest {
|
||||||
val result = factory.createCallAnswer(sdpAnswer, alice, callId, bobSigner)
|
val result = factory.createCallAnswer(sdpAnswer, alice, callId, bobSigner)
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ class NipACGiftWrapRoundTripTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun iceCandidate_roundTrips_throughGiftWrap() =
|
fun iceCandidateRoundTripsThroughGiftWrap() =
|
||||||
runTest {
|
runTest {
|
||||||
val candidateJson =
|
val candidateJson =
|
||||||
CallIceCandidateEvent.serializeCandidate(
|
CallIceCandidateEvent.serializeCandidate(
|
||||||
@@ -163,7 +163,7 @@ class NipACGiftWrapRoundTripTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun hangup_roundTrips_throughGiftWrap() =
|
fun hangupRoundTripsThroughGiftWrap() =
|
||||||
runTest {
|
runTest {
|
||||||
val result = factory.createHangup(bob, callId, "user ended", aliceSigner)
|
val result = factory.createHangup(bob, callId, "user ended", aliceSigner)
|
||||||
|
|
||||||
@@ -176,7 +176,7 @@ class NipACGiftWrapRoundTripTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun hangup_emptyReason_roundTrips() =
|
fun hangupEmptyReasonRoundTrips() =
|
||||||
runTest {
|
runTest {
|
||||||
val result = factory.createHangup(bob, callId, "", aliceSigner)
|
val result = factory.createHangup(bob, callId, "", aliceSigner)
|
||||||
|
|
||||||
@@ -190,7 +190,7 @@ class NipACGiftWrapRoundTripTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun reject_roundTrips_throughGiftWrap() =
|
fun rejectRoundTripsThroughGiftWrap() =
|
||||||
runTest {
|
runTest {
|
||||||
val result = factory.createReject(alice, callId, "", bobSigner)
|
val result = factory.createReject(alice, callId, "", bobSigner)
|
||||||
|
|
||||||
@@ -202,7 +202,7 @@ class NipACGiftWrapRoundTripTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun busyReject_roundTrips_throughGiftWrap() =
|
fun busyRejectRoundTripsThroughGiftWrap() =
|
||||||
runTest {
|
runTest {
|
||||||
val result = factory.createReject(alice, callId, "busy", bobSigner)
|
val result = factory.createReject(alice, callId, "busy", bobSigner)
|
||||||
|
|
||||||
@@ -216,7 +216,7 @@ class NipACGiftWrapRoundTripTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun renegotiate_roundTrips_throughGiftWrap() =
|
fun renegotiateRoundTripsThroughGiftWrap() =
|
||||||
runTest {
|
runTest {
|
||||||
val newSdp = "v=0\r\no=- 4611731400430051338 3 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0"
|
val newSdp = "v=0\r\no=- 4611731400430051338 3 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0"
|
||||||
val result = factory.createRenegotiate(newSdp, bob, callId, aliceSigner)
|
val result = factory.createRenegotiate(newSdp, bob, callId, aliceSigner)
|
||||||
@@ -234,7 +234,7 @@ class NipACGiftWrapRoundTripTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun groupCallOffer_perPeerWraps_eachDecryptableOnlyByTarget() =
|
fun groupCallOfferPerPeerWrapsEachDecryptableOnlyByTarget() =
|
||||||
runTest {
|
runTest {
|
||||||
val result =
|
val result =
|
||||||
factory.createGroupCallOffer(
|
factory.createGroupCallOffer(
|
||||||
@@ -281,7 +281,7 @@ class NipACGiftWrapRoundTripTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun groupCallAnswer_broadcastWraps_eachDecryptableByTarget() =
|
fun groupCallAnswerBroadcastWrapsEachDecryptableByTarget() =
|
||||||
runTest {
|
runTest {
|
||||||
val allMembers = setOf(alice, bob, carol)
|
val allMembers = setOf(alice, bob, carol)
|
||||||
val result = factory.createGroupCallAnswer(sdpAnswer, allMembers, callId, bobSigner)
|
val result = factory.createGroupCallAnswer(sdpAnswer, allMembers, callId, bobSigner)
|
||||||
@@ -311,7 +311,7 @@ class NipACGiftWrapRoundTripTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun groupHangup_allMembers_receiveIdenticalInnerEvent() =
|
fun groupHangupAllMembersReceiveIdenticalInnerEvent() =
|
||||||
runTest {
|
runTest {
|
||||||
val members = setOf(bob, carol)
|
val members = setOf(bob, carol)
|
||||||
val result = factory.createGroupHangup(members, callId, "leaving", aliceSigner)
|
val result = factory.createGroupHangup(members, callId, "leaving", aliceSigner)
|
||||||
@@ -336,7 +336,7 @@ class NipACGiftWrapRoundTripTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun groupReject_allMembers_receiveIdenticalInnerEvent() =
|
fun groupRejectAllMembersReceiveIdenticalInnerEvent() =
|
||||||
runTest {
|
runTest {
|
||||||
val members = setOf(alice, carol)
|
val members = setOf(alice, carol)
|
||||||
val result = factory.createGroupReject(members, callId, "busy", bobSigner)
|
val result = factory.createGroupReject(members, callId, "busy", bobSigner)
|
||||||
@@ -360,7 +360,7 @@ class NipACGiftWrapRoundTripTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun fullP2PFlow_allSignalingEvents_roundTrip() =
|
fun fullP2PFlowAllSignalingEventsRoundTrip() =
|
||||||
runTest {
|
runTest {
|
||||||
// Step 1: Alice sends offer to Bob
|
// Step 1: Alice sends offer to Bob
|
||||||
val offerResult = factory.createCallOffer(sdpOffer, bob, callId, CallType.VIDEO, aliceSigner)
|
val offerResult = factory.createCallOffer(sdpOffer, bob, callId, CallType.VIDEO, aliceSigner)
|
||||||
@@ -413,7 +413,7 @@ class NipACGiftWrapRoundTripTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun wrapMetadata_isCorrect() =
|
fun wrapMetadataIsCorrect() =
|
||||||
runTest {
|
runTest {
|
||||||
val result = factory.createCallOffer(sdpOffer, bob, callId, CallType.VOICE, aliceSigner)
|
val result = factory.createCallOffer(sdpOffer, bob, callId, CallType.VOICE, aliceSigner)
|
||||||
val wrap = result.wrap
|
val wrap = result.wrap
|
||||||
@@ -426,7 +426,7 @@ class NipACGiftWrapRoundTripTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun eachWrap_usesUniqueEphemeralKey() =
|
fun eachWrapUsesUniqueEphemeralKey() =
|
||||||
runTest {
|
runTest {
|
||||||
val result1 = factory.createCallOffer(sdpOffer, bob, callId, CallType.VOICE, aliceSigner)
|
val result1 = factory.createCallOffer(sdpOffer, bob, callId, CallType.VOICE, aliceSigner)
|
||||||
val result2 = factory.createCallOffer(sdpOffer, bob, callId, CallType.VOICE, aliceSigner)
|
val result2 = factory.createCallOffer(sdpOffer, bob, callId, CallType.VOICE, aliceSigner)
|
||||||
@@ -443,7 +443,7 @@ class NipACGiftWrapRoundTripTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun innerEventSignature_isVerifiable_afterUnwrap() =
|
fun innerEventSignatureIsVerifiableAfterUnwrap() =
|
||||||
runTest {
|
runTest {
|
||||||
val result = factory.createCallOffer(sdpOffer, bob, callId, CallType.VIDEO, aliceSigner)
|
val result = factory.createCallOffer(sdpOffer, bob, callId, CallType.VIDEO, aliceSigner)
|
||||||
val inner = result.wrap.unwrapThrowing(bobSigner)
|
val inner = result.wrap.unwrapThrowing(bobSigner)
|
||||||
@@ -458,7 +458,7 @@ class NipACGiftWrapRoundTripTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun sdpWithSpecialChars_survivesGiftWrapRoundTrip() =
|
fun sdpWithSpecialCharsSurvivesGiftWrapRoundTrip() =
|
||||||
runTest {
|
runTest {
|
||||||
val complexSdp =
|
val complexSdp =
|
||||||
"v=0\r\n" +
|
"v=0\r\n" +
|
||||||
@@ -481,7 +481,7 @@ class NipACGiftWrapRoundTripTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun iceCandidateWithSpecialChars_survivesGiftWrapRoundTrip() =
|
fun iceCandidateWithSpecialCharsSurvivesGiftWrapRoundTrip() =
|
||||||
runTest {
|
runTest {
|
||||||
val candidateSdp = """candidate:842163049 1 udp 1677729535 203.0.113.1 44323 typ srflx raddr 0.0.0.0 rport 0 generation 0 ufrag abc+def network-id 1"""
|
val candidateSdp = """candidate:842163049 1 udp 1677729535 203.0.113.1 44323 typ srflx raddr 0.0.0.0 rport 0 generation 0 ufrag abc+def network-id 1"""
|
||||||
val json = CallIceCandidateEvent.serializeCandidate(candidateSdp, "audio", 0)
|
val json = CallIceCandidateEvent.serializeCandidate(candidateSdp, "audio", 0)
|
||||||
@@ -498,7 +498,7 @@ class NipACGiftWrapRoundTripTest {
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun groupOfferWithContext_perPeerSdp_allPTagsVisible() =
|
fun groupOfferWithContextPerPeerSdpAllPTagsVisible() =
|
||||||
runTest {
|
runTest {
|
||||||
// Caller creates per-peer offer using the group-context overload
|
// Caller creates per-peer offer using the group-context overload
|
||||||
val bobResult =
|
val bobResult =
|
||||||
|
|||||||
Reference in New Issue
Block a user