MCPcopy Create free account
hub / github.com/pion/ice / TestHandlerNotifier_EnqueueConnectionState_AfterClose

Function TestHandlerNotifier_EnqueueConnectionState_AfterClose

agent_handlers_test.go:127–147  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

125}
126
127func TestHandlerNotifier_EnqueueConnectionState_AfterClose(t *testing.T) {
128 defer test.CheckRoutines(t)()
129
130 connCh := make(chan struct{}, 1)
131 notifier := &handlerNotifier{
132 connectionStateFunc: func(ConnectionState) { connCh <- struct{}{} },
133 done: make(chan struct{}),
134 }
135
136 notifier.Close(false)
137 notifier.EnqueueConnectionState(ConnectionStateConnected)
138
139 assert.Never(t, func() bool {
140 select {
141 case <-connCh:
142 return true
143 default:
144 return false
145 }
146 }, 250*time.Millisecond, 10*time.Millisecond, "connectionStateFunc should not be called after close")
147}
148
149func TestHandlerNotifier_EnqueueCandidate_AfterClose(t *testing.T) {
150 defer test.CheckRoutines(t)()

Callers

nothing calls this directly

Calls 2

CloseMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…