mirror of
https://github.com/pion/webrtc.git
synced 2025-11-02 23:34:17 +08:00
Remove duplicate unittests for SetConfiguration
This commit is contained in:
committed by
Sean DuBois
parent
d7697f88bc
commit
a786223fad
@@ -224,96 +224,6 @@ func TestRTCPeerConnection_SetConfiguration(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
// TODO
|
||||
// func TestRTCPeerConnection_SetConfiguration(t *testing.T) {
|
||||
// pc, err := New(RTCConfiguration{})
|
||||
// assert.Nil(t, err)
|
||||
// pc.Close()
|
||||
//
|
||||
// expected := InvalidStateError{Err: ErrConnectionClosed}
|
||||
// actualError := pc.SetConfiguration(RTCConfiguration{})
|
||||
// assert.EqualError(t, actualError, expected.Error())
|
||||
// }
|
||||
|
||||
func TestRTCPeerConnection_SetConfiguration_IsClosed(t *testing.T) {
|
||||
pc, err := New(RTCConfiguration{})
|
||||
assert.Nil(t, err)
|
||||
pc.Close()
|
||||
|
||||
expected := InvalidStateError{Err: ErrConnectionClosed}
|
||||
actualError := pc.SetConfiguration(RTCConfiguration{})
|
||||
assert.EqualError(t, actualError, expected.Error())
|
||||
}
|
||||
|
||||
func TestRTCPeerConnection_SetConfiguration_PeerIdentity(t *testing.T) {
|
||||
pc, err := New(RTCConfiguration{})
|
||||
assert.Nil(t, err)
|
||||
|
||||
expected := InvalidModificationError{Err: ErrModifyingPeerIdentity}
|
||||
actualError := pc.SetConfiguration(RTCConfiguration{
|
||||
PeerIdentity: "unittest",
|
||||
})
|
||||
assert.EqualError(t, actualError, expected.Error())
|
||||
}
|
||||
|
||||
func TestRTCPeerConnection_SetConfiguration_Certificates_Len(t *testing.T) {
|
||||
sk, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
|
||||
assert.Nil(t, err)
|
||||
|
||||
certificate1, err := GenerateCertificate(sk)
|
||||
assert.Nil(t, err)
|
||||
|
||||
certificate2, err := GenerateCertificate(sk)
|
||||
assert.Nil(t, err)
|
||||
|
||||
pc, err := New(RTCConfiguration{})
|
||||
assert.Nil(t, err)
|
||||
|
||||
expected := InvalidModificationError{Err: ErrModifyingCertificates}
|
||||
actualError := pc.SetConfiguration(RTCConfiguration{
|
||||
Certificates: []RTCCertificate{*certificate1, *certificate2},
|
||||
})
|
||||
assert.EqualError(t, actualError, expected.Error())
|
||||
}
|
||||
|
||||
func TestRTCPeerConnection_SetConfiguration_Certificates_Equals(t *testing.T) {
|
||||
sk, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
|
||||
assert.Nil(t, err)
|
||||
|
||||
certificate, err := GenerateCertificate(sk)
|
||||
assert.Nil(t, err)
|
||||
|
||||
pc, err := New(RTCConfiguration{})
|
||||
|
||||
expected := InvalidModificationError{Err: ErrModifyingCertificates}
|
||||
actualError := pc.SetConfiguration(RTCConfiguration{
|
||||
Certificates: []RTCCertificate{*certificate},
|
||||
})
|
||||
assert.EqualError(t, actualError, expected.Error())
|
||||
}
|
||||
|
||||
func TestRTCPeerConnection_SetConfiguration_BundlePolicy(t *testing.T) {
|
||||
pc, err := New(RTCConfiguration{})
|
||||
assert.Nil(t, err)
|
||||
|
||||
expected := InvalidModificationError{Err: ErrModifyingBundlePolicy}
|
||||
actualError := pc.SetConfiguration(RTCConfiguration{
|
||||
BundlePolicy: RTCBundlePolicyMaxCompat,
|
||||
})
|
||||
assert.EqualError(t, actualError, expected.Error())
|
||||
}
|
||||
|
||||
func TestRTCPeerConnection_SetConfiguration_RtcpMuxPolicy(t *testing.T) {
|
||||
pc, err := New(RTCConfiguration{})
|
||||
assert.Nil(t, err)
|
||||
|
||||
expected := InvalidModificationError{Err: ErrModifyingRtcpMuxPolicy}
|
||||
actualError := pc.SetConfiguration(RTCConfiguration{
|
||||
RtcpMuxPolicy: RTCRtcpMuxPolicyNegotiate,
|
||||
})
|
||||
assert.EqualError(t, actualError, expected.Error())
|
||||
}
|
||||
|
||||
func TestRTCPeerConnection_GetConfiguration(t *testing.T) {
|
||||
pc, err := New(RTCConfiguration{})
|
||||
assert.Nil(t, err)
|
||||
|
||||
Reference in New Issue
Block a user